Skip to content

Commit

Permalink
add tooltip to the buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
lll2yu committed Jan 22, 2019
1 parent bdc4883 commit 09b1bbc
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 11 deletions.
27 changes: 20 additions & 7 deletions Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ Rectangle {
fillMode: Image.PreserveAspectFit
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: sddm.powerOff()
onEntered: {
var component = Qt.createComponent("ShutdownToolTip.qml");
if (component.status == Component.Ready) {
var tooltip = component.createObject(shutdownBtn);
tooltip.x = -45
tooltip.y = 60
tooltip.destroy(600);
}
}
}
}
AnimatedImage {
Expand All @@ -142,7 +152,17 @@ Rectangle {
fillMode: Image.PreserveAspectFit
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: sddm.reboot()
onEntered: {
var component = Qt.createComponent("RebootToolTip.qml");
if (component.status == Component.Ready) {
var tooltip = component.createObject(rebootBtn);
tooltip.x = -45
tooltip.y = 50
tooltip.destroy(600);
}
}
}
}
ComboBox {
Expand All @@ -151,7 +171,6 @@ Rectangle {
width: 200
x: 15
y: 20
// arrowIcon: "angle-down.png"
model: sessionModel
index: sessionModel.lastIndex
color: "#000"
Expand All @@ -160,12 +179,6 @@ Rectangle {
hoverColor: "#d2738a"
textColor: "#c1b492"
arrowIcon: "angle-down.png"
// style: ComboBoxStyle {
// selectedTextColor: "#000"
// selectionColor: "#d2738a"
// background: Rectangle {
// }
// }
KeyNavigation.backtab: password; KeyNavigation.tab: rebootBtn;
}
Audio {
Expand Down
18 changes: 18 additions & 0 deletions RebootToolTip.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import QtQuick 2.5

Rectangle {
color:"black"
width:130
height: 32
border.width: 1
border.color: "#D27486"
property string label: "Reboot"
Text {
color: "#D27486"
font.pixelSize : 14
text: parent.label
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
}
18 changes: 18 additions & 0 deletions ShutdownToolTip.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import QtQuick 2.5

Rectangle {
color:"black"
width:130
height: 32
border.width: 1
border.color: "#D27486"
property string label: "Shutdown"
Text {
color: "#D27486"
font.pixelSize : 14
text: parent.label
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
}
8 changes: 4 additions & 4 deletions metadata.desktop
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[SddmGreeterTheme]
Name=LainWired
Description=Inspired by fauux.neocities.org
Author=Andrés "mixedCase" Rodríguez
Copyright=(c) 2016, Andrés Rodríguez
Author=Andrés "mixedCase" Rodríguez, Gagandeep "lll2yu" Singh
Copyright=(c) 2016, Andrés Rodríguez, (c) 2019, Gagandeep Singh
License=CC-BY-SA
Type=sddm-theme
Version=0.9
Website=https://gitlab.com/mixedCase/sddm-lain-wired-theme
Version=0.9.1
Website=https://gitlab.com/mixedCase/sddm-lain-wired-theme, https://github.com/lll2yu/sddm-lain-wired-theme
Screenshot=screenshot.png
MainScript=Main.qml
Theme-Id=lainwired
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09b1bbc

Please sign in to comment.