forked from djfumberger/retromega
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for battery indicator. - Fixed layout when Pegasus is not in fullscreen mode. - Time and battery now only will show when in fullscreen mode.
- Loading branch information
David Fumberger
committed
Apr 10, 2021
1 parent
ce677fa
commit 194c13c
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import QtQuick 2.12 | ||
import QtGraphicalEffects 1.12 | ||
import QtGraphicalEffects 1.0 | ||
import QtQuick.Layouts 1.15 | ||
Item { | ||
width: 26 | ||
height: 14 | ||
|
||
property var lightStyle : false | ||
|
||
property var percent: { | ||
api.device ? api.device.batteryPercent : 0 | ||
} | ||
|
||
Image { | ||
id: iconImage | ||
source: lightStyle ? "../assets/images/battery.png" : "../assets/images/battery-dark.png" | ||
anchors.verticalCenter: parent.verticalCenter | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
} | ||
|
||
Rectangle { | ||
anchors.leftMargin: 2 | ||
anchors.topMargin: 3 | ||
anchors.top: parent.top | ||
anchors.left: parent.left | ||
color: lightStyle ? "#ffffff" : "#000000" | ||
radius: 2 | ||
width: Math.max(percent * 17.6, 2) | ||
height: 8 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters