Dynamic Brightness Ico in osd and about window #8

Merged
tr1xem merged 4 commits from macos into macos 2025-07-30 14:24:56 +00:00
12 changed files with 299 additions and 154 deletions

No files matched your search

-11
View File
@@ -1,11 +0,0 @@
<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0 -.00047914)" fill="#dedede">
<rect y="6" width="5" height="4" ry="1" fill-rule="evenodd"/>
<path d="m6 3-3 3v4l3 3z"/>
<g fill-rule="evenodd">
<path d="M 13.139,1.428 C 12.594,1 12,1.652 12.455,2.16 A 8,8 0 0 1 15,8 8,8 0 0 1 12.446,13.852 C 12,14.323 12.626,15 13.123,14.58 A 9,9 0 0 0 16,8 9,9 0 0 0 13.139,1.428 Z"/>
<path d="m10.775 2.889c-0.587-0.535-1.199 0.225-0.684 0.732a6 6 0 0 1 1.909 4.379 6 6 0 0 1-1.916 4.389c-0.469 0.446 0.173 1.146 0.68 0.728a7 7 0 0 0 2.236-5.117 7 7 0 0 0-2.225-5.111z"/>
<path d="M 8.41,4.35 C 7.89,3.856 7.255,4.57 7.727,5.08 A 4,4 0 0 1 9,8 4,4 0 0 1 7.723,10.926 c -0.473,0.43 0.14,1.152 0.68,0.73 A 5,5 0 0 0 10,8 5,5 0 0 0 8.41,4.35 Z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 820 B

+5 -140
View File
@@ -1,141 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg2"
width="16"
height="16"
viewBox="0 0 16 16"
sodipodi:docname="brightness-display-symbolic.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="941"
id="namedview4"
showgrid="true"
inkscape:zoom="14.75"
inkscape:cx="8.2021559"
inkscape:cy="9.6684194"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid817"
spacingx="1"
spacingy="1" />
</sodipodi:namedview>
<ellipse
style="opacity:1;fill:#f5f5f5;stroke-width:0.747454;fill-opacity:1"
id="path831"
cx="8.0105047"
cy="8.0086908"
rx="4.0077391"
ry="4.0165114" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect833"
width="2"
height="3"
x="7"
y="0"
rx="1"
ry="1" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect837"
width="3"
height="2"
x="13"
y="7"
rx="1"
ry="1" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect841"
width="2"
height="3"
x="7"
y="13"
rx="1"
ry="1" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect845"
width="3"
height="2"
x="0"
y="7"
rx="1"
ry="1" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect853"
width="2"
height="3"
x="-1"
y="3.3137085"
rx="1"
ry="1"
transform="rotate(-45)" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect855"
width="3"
height="2"
x="5"
y="10.313708"
rx="1"
ry="1"
transform="rotate(-45)" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect857"
width="2"
height="3"
x="-1"
y="16.313709"
rx="1"
ry="1"
transform="rotate(-45)" />
<rect
style="opacity:1;fill:#f5f5f5;fill-opacity:1"
id="rect859"
width="3"
height="2"
x="-8"
y="10.313708"
rx="1"
ry="1"
transform="rotate(-45)" />
<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<style id="current-color-scheme" type="text/css"/>
</defs>
<path d="m7.75 2v2.5h0.5v-2.5zm-3.8965 1.5-0.35352 0.35352 1.7676 1.7676 0.35352-0.35352zm8.1465 0-1.7676 1.7676 0.35352 0.35352 1.7676-1.7676zm-4 1.5a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3zm0.011719 0.98242a2.0292 2.0292 0 0 1 2.0293 2.0293 2.0292 2.0292 0 0 1-2.0293 2.0293 2.0292 2.0292 0 0 1-2.0293-2.0293 2.0292 2.0292 0 0 1 2.0293-2.0293zm-6.0117 1.7676v0.5h2.5v-0.5zm9.5 0v0.5h2.5v-0.5zm-6.2324 2.6289-1.7676 1.7676 0.35352 0.35352 1.7676-1.7676zm5.4648 0-0.35352 0.35352 1.7676 1.7676 0.35352-0.35352zm-2.9824 1.1211v2.5h0.5v-2.5z" fill="#f2f2f2" style="paint-order:fill markers stroke"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 770 B

+6
View File
@@ -0,0 +1,6 @@
<svg width="22" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color:#f2f2f2; } .ColorScheme-Highlight { color:#4285f4; }</style>
</defs>
<path d="m10.75 3.5a0.25 0.25 0 0 0-0.25 0.25v1.5c0 0.139 0.112 0.25 0.25 0.25h0.5a0.25 0.25 0 0 0 0.25-0.25v-1.5a0.25 0.25 0 0 0-0.25-0.25zm-4.699 1.947a0.25 0.25 0 0 0-0.178 0.073l-0.353 0.353a0.25 0.25 0 0 0 0 0.354l1.06 1.06a0.25 0.25 0 0 0 0.354 0l0.353-0.353a0.25 0.25 0 0 0 0-0.354l-1.06-1.06a0.246 0.246 0 0 0-0.176-0.073zm9.898 0a0.246 0.246 0 0 0-0.175 0.073l-1.06 1.06a0.25 0.25 0 0 0 0 0.354l0.353 0.353a0.25 0.25 0 0 0 0.353 0l1.06-1.06a0.25 0.25 0 0 0 0-0.354l-0.353-0.353a0.25 0.25 0 0 0-0.178-0.073zm-4.949 2.053a3.5 3.5 0 0 0-3.5 3.5 3.5 3.5 0 0 0 3.5 3.5 3.5 3.5 0 0 0 3.5-3.5 3.5 3.5 0 0 0-3.5-3.5zm0 1a2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5zm-7.25 2a0.25 0.25 0 0 0-0.25 0.25v0.5c0 0.139 0.112 0.25 0.25 0.25h1.5a0.25 0.25 0 0 0 0.25-0.25v-0.5a0.25 0.25 0 0 0-0.25-0.25zm13 0a0.25 0.25 0 0 0-0.25 0.25v0.5c0 0.139 0.112 0.25 0.25 0.25h1.5a0.25 0.25 0 0 0 0.25-0.25v-0.5a0.25 0.25 0 0 0-0.25-0.25zm-9.992 4.139a0.252 0.252 0 0 0-0.178 0.074l-1.06 1.06a0.25 0.25 0 0 0 0 0.354l0.353 0.353a0.25 0.25 0 0 0 0.354 0l1.06-1.06a0.25 0.25 0 0 0 0-0.354l-0.353-0.353a0.248 0.248 0 0 0-0.176-0.074zm8.484 0a0.248 0.248 0 0 0-0.175 0.074l-0.354 0.353a0.25 0.25 0 0 0 0 0.354l1.06 1.06a0.25 0.25 0 0 0 0.354 0l0.354-0.353a0.25 0.25 0 0 0 0-0.354l-1.06-1.06a0.252 0.252 0 0 0-0.179-0.074zm-4.492 1.861a0.25 0.25 0 0 0-0.25 0.25v1.5c0 0.139 0.112 0.25 0.25 0.25h0.5a0.25 0.25 0 0 0 0.25-0.25v-1.5a0.25 0.25 0 0 0-0.25-0.25z" class="ColorScheme-Text" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-613 191)">
<path d="M620.25-190a.25.25 0 0 0-.25.25v1.5c0 .139.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25zm-4.699 1.947a.25.25 0 0 0-.178.073l-.353.353a.25.25 0 0 0 0 .354l1.06 1.06a.25.25 0 0 0 .354 0l.353-.353a.25.25 0 0 0 0-.354l-1.06-1.06a.246.246 0 0 0-.176-.073zm9.898 0a.246.246 0 0 0-.175.073l-1.06 1.06a.25.25 0 0 0 0 .354l.353.353a.25.25 0 0 0 .353 0l1.06-1.06a.25.25 0 0 0 0-.354l-.353-.353a.25.25 0 0 0-.178-.073zM620.5-186a3.5 3.5 0 0 0-3.5 3.5 3.5 3.5 0 0 0 3.5 3.5 3.5 3.5 0 0 0 3.5-3.5 3.5 3.5 0 0 0-3.5-3.5zm0 1a2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5zm-7.25 2a.25.25 0 0 0-.25.25v.5c0 .139.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25zm13 0a.25.25 0 0 0-.25.25v.5c0 .139.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25zm-9.992 4.139a.252.252 0 0 0-.178.074l-1.06 1.06a.25.25 0 0 0 0 .354l.353.353a.25.25 0 0 0 .354 0l1.06-1.06a.25.25 0 0 0 0-.354l-.353-.353a.248.248 0 0 0-.176-.074zm8.484 0a.248.248 0 0 0-.175.074l-.354.353a.25.25 0 0 0 0 .354l1.06 1.06a.25.25 0 0 0 .354 0l.354-.353a.25.25 0 0 0 0-.354l-1.06-1.06a.252.252 0 0 0-.179-.074zM620.25-177a.25.25 0 0 0-.25.25v1.5c0 .139.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25z" fill="#dedede" overflow="visible" style="isolation:auto;mix-blend-mode:normal"/>
</g>
<path d="m6 5.3418a3.5 3.5 0 0 0-2 3.1582 3.5 3.5 0 0 0 2 3.1582v-6.3164z" fill="#dedede" fill-rule="evenodd" style="paint-order:stroke fill markers"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-613 191)">
<path d="M620.25-190a.25.25 0 0 0-.25.25v1.5c0 .139.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25zm-4.699 1.947a.25.25 0 0 0-.178.073l-.353.353a.25.25 0 0 0 0 .354l1.06 1.06a.25.25 0 0 0 .354 0l.353-.353a.25.25 0 0 0 0-.354l-1.06-1.06a.246.246 0 0 0-.176-.073zm9.898 0a.246.246 0 0 0-.175.073l-1.06 1.06a.25.25 0 0 0 0 .354l.353.353a.25.25 0 0 0 .353 0l1.06-1.06a.25.25 0 0 0 0-.354l-.353-.353a.25.25 0 0 0-.178-.073zM620.5-186a3.5 3.5 0 0 0-3.5 3.5 3.5 3.5 0 0 0 3.5 3.5 3.5 3.5 0 0 0 3.5-3.5 3.5 3.5 0 0 0-3.5-3.5zm0 1a2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5 2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5zm-7.25 2a.25.25 0 0 0-.25.25v.5c0 .139.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25zm13 0a.25.25 0 0 0-.25.25v.5c0 .139.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25zm-9.992 4.139a.252.252 0 0 0-.178.074l-1.06 1.06a.25.25 0 0 0 0 .354l.353.353a.25.25 0 0 0 .354 0l1.06-1.06a.25.25 0 0 0 0-.354l-.353-.353a.248.248 0 0 0-.176-.074zm8.484 0a.248.248 0 0 0-.175.074l-.354.353a.25.25 0 0 0 0 .354l1.06 1.06a.25.25 0 0 0 .354 0l.354-.353a.25.25 0 0 0 0-.354l-1.06-1.06a.252.252 0 0 0-.179-.074zM620.25-177a.25.25 0 0 0-.25.25v1.5c0 .139.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-1.5a.25.25 0 0 0-.25-.25z" fill="#dedede" overflow="visible" style="isolation:auto;mix-blend-mode:normal"/>
</g>
<path d="m7.5 5a3.5 3.5 0 0 0-3.5 3.5 3.5 3.5 0 0 0 3.5 3.5 3.5 3.5 0 0 0 0.5-0.039062v-6.9199a3.5 3.5 0 0 0-0.5-0.041016z" fill="#dedede" fill-rule="evenodd" style="paint-order:stroke fill markers"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+6
View File
@@ -0,0 +1,6 @@
<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-613 191)">
<path d="m620.25-190c-0.13807 0-0.25 0.11193-0.25 0.25v1.5c0 0.139 0.112 0.25 0.25 0.25h0.5c0.13807 0 0.25-0.11193 0.25-0.25v-1.5c0-0.13807-0.11193-0.25-0.25-0.25zm-4.699 1.947c-0.0667-3.8e-4 -0.13078 0.0259-0.178 0.073l-0.353 0.353c-0.0979 0.0977-0.0979 0.25632 0 0.354l1.06 1.06c0.0977 0.0979 0.25632 0.0979 0.354 0l0.353-0.353c0.0979-0.0977 0.0979-0.25632 0-0.354l-1.06-1.06c-0.0465-0.047-0.10991-0.0733-0.176-0.073zm9.898 0c-0.0657-3e-5 -0.12877 0.0263-0.175 0.073l-1.06 1.06c-0.0979 0.0977-0.0979 0.25632 0 0.354l0.353 0.353c0.0976 0.0973 0.25543 0.0973 0.353 0l1.06-1.06c0.0979-0.0977 0.0979-0.25632 0-0.354l-0.353-0.353c-0.0472-0.0471-0.1113-0.0734-0.178-0.073zm-12.199 5.053c-0.13807 0-0.25 0.11193-0.25 0.25v0.5c0 0.139 0.112 0.25 0.25 0.25h1.5c0.13807 0 0.25-0.11193 0.25-0.25v-0.5c0-0.13807-0.11193-0.25-0.25-0.25zm13 0c-0.13807 0-0.25 0.11193-0.25 0.25v0.5c0 0.139 0.112 0.25 0.25 0.25h1.5c0.13807 0 0.25-0.11193 0.25-0.25v-0.5c0-0.13807-0.11193-0.25-0.25-0.25zm-9.992 4.139c-0.0668 1e-4 -0.13082 0.0267-0.178 0.074l-1.06 1.06c-0.0979 0.0977-0.0979 0.25632 0 0.354l0.353 0.353c0.0977 0.0979 0.25632 0.0979 0.354 0l1.06-1.06c0.0979-0.0977 0.0979-0.25632 0-0.354l-0.353-0.353c-0.0464-0.0472-0.10981-0.0738-0.176-0.074zm8.484 0c-0.0658 4.6e-4 -0.1288 0.0271-0.175 0.074l-0.354 0.353c-0.0979 0.0977-0.0979 0.25632 0 0.354l1.06 1.06c0.0977 0.0979 0.25632 0.0979 0.354 0l0.354-0.353c0.0979-0.0977 0.0979-0.25632 0-0.354l-1.06-1.06c-0.0474-0.0475-0.11186-0.0742-0.179-0.074zm-4.492 1.861c-0.13807 0-0.25 0.11193-0.25 0.25v1.5c0 0.139 0.112 0.25 0.25 0.25h0.5c0.13807 0 0.25-0.11193 0.25-0.25v-1.5c0-0.13807-0.11193-0.25-0.25-0.25z" color="#000000" fill="#dedede" overflow="visible" style="isolation:auto;mix-blend-mode:normal"/>
</g>
<circle cx="7.5" cy="8.5" r="3.5" fill="#dedede" fill-rule="evenodd" style="paint-order:stroke fill markers"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+1
View File
@@ -5,6 +5,7 @@
@import url("./styles/switcher.css");
@import url("./styles/launcher.css");
@import url("./styles/osd.css");
@import url("./styles/about.css");
* {
all: unset;
+2
View File
@@ -7,6 +7,7 @@ from fabric.utils import get_relative_path, monitor_file
from modules.dock import Dock
from modules.launcher.main import Launcher
from modules.osd import OSD
from modules.about import About
# from modules.corners import Corners
from modules.panel.main import Panel
@@ -28,6 +29,7 @@ if __name__ == "__main__":
# Load configuration
from config.data import load_config
About().toggle(None)
config = load_config()
panel = Panel()
+178
View File
@@ -0,0 +1,178 @@
import subprocess
import re
import gi # type: ignore
from fabric.widgets.label import Label
from fabric.widgets.button import Button
from fabric.widgets.box import Box
from utils.wayland import WaylandWindow as Window
from fabric.utils.helpers import exec_shell_command_async, get_relative_path
from gi.repository import Gtk, GdkPixbuf # type: ignore
def read_dmi(field):
try:
with open(f"/sys/class/dmi/id/{field}") as f:
return f.read().strip()
except Exception:
return "Unknown"
def get_gpu_name():
try:
output = (
subprocess.check_output(
"lspci -nn | grep -i 'VGA compatible controller'", shell=True, text=True
)
.strip()
.split("\n")
)
def clean(line):
matches = re.findall(r"\[(.*?)\]", line)
if len(matches) >= 2:
return matches[1].strip()
desc = line.split(":", 2)[-1]
return desc.replace("Corporation", "").strip()
for line in output:
if any(vendor in line.lower() for vendor in ["nvidia", "amd", "radeon"]):
return clean(line)
if output:
return clean(output[0])
return "Unknown GPU"
except Exception:
return "Unknown GPU"
class About(Gtk.Window):
def __init__(self):
super().__init__(title="About Menu")
self.set_default_size(300, 550)
self.set_size_request(300, 500)
self.set_resizable(False)
self.set_wmclass("modus-about-menu", "modus-about-menu")
self.set_name("about-menu")
self.set_visible(False)
main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
main_box.set_margin_top(10)
main_box.set_margin_bottom(20)
main_box.set_margin_start(20)
main_box.set_margin_end(20)
# Logo
logo_box = Gtk.Box(halign=Gtk.Align.CENTER, valign=Gtk.Align.CENTER)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
get_relative_path("../config/assets/icons/imac.svg"),
158,
108,
preserve_aspect_ratio=True,
)
logo = Gtk.Image.new_from_pixbuf(pixbuf)
logo_box.pack_start(logo, False, False, 0)
logo_box.set_margin_top(60)
# Product Name & Vendor
name_label = Gtk.Label()
name_label.set_margin_top(30)
name_label.set_markup(
f"<b><span size='16000'>{read_dmi('product_name')}</span></b>"
)
vendor_label = Gtk.Label(label=read_dmi("sys_vendor"))
vendor_label.set_name("vendor-label")
vendor_label.set_halign(Gtk.Align.CENTER)
# Info Grid
info_grid = Gtk.Grid()
info_grid.set_row_spacing(6)
info_grid.set_column_spacing(10)
info_grid.set_valign(Gtk.Align.CENTER)
info_grid.set_halign(Gtk.Align.FILL)
def make_label(text, align_end=False, name=None):
label = Gtk.Label(label=text)
label.set_halign(Gtk.Align.END if align_end else Gtk.Align.START)
if name:
label.set_name(name)
return label
# Info values
labels = [
(
"Kernel",
subprocess.run(
"uname -r", shell=True, capture_output=True, text=True
).stdout.strip(),
),
(
"CPU",
subprocess.run(
"lscpu | grep 'Model name:' | cut -d ':' -f2-",
shell=True,
capture_output=True,
text=True,
).stdout.strip(),
),
(
"Memory",
subprocess.run(
"free -h --giga | grep Mem | tr -s ' ' | cut -d ' ' -f 2",
shell=True,
capture_output=True,
text=True,
).stdout.strip(),
),
("GPU", get_gpu_name()),
(
"Uptime",
subprocess.run(
"uptime -p", shell=True, capture_output=True, text=True
).stdout.strip(),
),
]
for i, (title, value) in enumerate(labels):
title_label = make_label(title, align_end=True)
value_label = make_label(value, align_end=False, name="info-label")
info_grid.attach(title_label, 0, i, 1, 1)
info_grid.attach(value_label, 1, i, 1, 1)
# Button
button_box = Gtk.Box(halign=Gtk.Align.CENTER)
button_box.set_margin_top(20)
more_info_button = Gtk.Button(label="More Info...", name="more-info-button")
more_info_button.connect("clicked", self.open_more_info)
button_box.pack_start(more_info_button, False, False, 0)
# Info Footer
info = Gtk.Label(
label="™ and © 2025 Linux Inc.\nAll rights reserved.\n\n",
justify=Gtk.Justification.CENTER,
halign=Gtk.Align.CENTER,
)
info.set_name("info-label")
info.set_margin_top(10)
# Layout Order
main_box.pack_start(logo_box, False, False, 0)
main_box.pack_start(name_label, False, False, 0)
main_box.pack_start(vendor_label, False, False, 0)
main_box.pack_start(info_grid, False, False, 0)
main_box.pack_start(button_box, False, False, 0)
main_box.pack_start(info, False, False, 0)
self.add(main_box)
def open_more_info(self, button):
# TODO: Implement the logic to open more information
pass
def toggle(self, b):
if self.get_visible():
self.hide()
else:
self.show_all()
+11 -2
View File
@@ -39,7 +39,7 @@ class AnimatedScale(Scale):
class BrightnessOSDContainer(Box):
def __init__(self, **kwargs):
super().__init__(**kwargs, orientation="v", spacing=12, name="osd")
super().__init__(**kwargs, orientation="v", spacing=3, name="osd")
self.brightness_service = Brightness.get_initial()
self.scale = AnimatedScale(
marks=(ScaleMark(value=i) for i in range(0, 101, 10)),
@@ -51,7 +51,7 @@ class BrightnessOSDContainer(Box):
)
self.osd_window_image = Svg(
get_relative_path("../config/assets/icons/brightness.svg"),
size=(64, 150),
size=(84, 150),
name="osd-image",
h_align="center",
v_align="center",
@@ -72,8 +72,17 @@ class BrightnessOSDContainer(Box):
if current_brightness != 0:
self.scale.animate_value(normalized_brightness)
def get_svg(self, value):
b_level = 0 if value == 0 else min(int(math.ceil(value / 33)), 3)
return b_level
def on_brightness_changed(self, _sender: any, value: float, *_args) -> None:
normalized_brightness = self._normalize_brightness(value)
self.osd_window_image.set_from_file(
get_relative_path(
f"../config/assets/icons/brightness/brightness-{self.get_svg(normalized_brightness)}.svg"
)
)
self.scale.animate_value(normalized_brightness)
def _normalize_brightness(self, brightness: float) -> float:
+77
View File
@@ -0,0 +1,77 @@
#about-menu {
background-color: alpha(#111, 0.6);
box-shadow: inset 0 -0.5px 0 .5px alpha(#555, 0.7), inset 0 0.5px 0 .5px alpha(#777, 0.7);
border: 1px solid alpha(#111, 0.3);
border-top: none;
border-radius: 1.25rem;
padding: 2rem;
}
#about-options {
background-color: alpha(#333, 0.9);
border-radius: 15px;
padding: 2rem;
}
#about-logo-box {
margin-top: 2rem;
margin-bottom: 2rem;
}
#about-button-box {
padding: 1rem;
}
#vendor-label{
color: #888888;
margin-top : -1rem;
}
#info-label{
color: #888888;
}
#about-info-title-box {
padding-left: 4rem;
}
#about-name-label {
font-size: 24px;
margin: 0px;
font-weight: 600;
}
#about-date-label {
font-size: 11px;
margin: 0px;
color: #ddd;
font-weight: 400;
margin-bottom: 2rem;
}
#about-chip-title-label,
#about-so-title-label,
#about-mem-title-label {
font-size: 12px;
margin: 0px;
margin-right: 10px;
font-weight: 500;
}
#more-info-button {
background-color: #2369ff;
border-radius: 5px;
padding: 0px 10px;
margin: 1px 2px;
transition: all 200ms ease-in-out;
}
#more-info-button:hover {
background-color: rgb(72, 130, 255);
}
#more-info-button label {
font-size: 12px;
margin: 0px;
font-weight: 400;
color: #ddd;
}
+1 -1
View File
@@ -12,7 +12,7 @@
#osd trough {
background: var(--surface);
min-height: 30px;
min-height: 15px;
margin-right: 4px;
transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
border-radius: 16px;