Initial New Windows

This commit is contained in:
tr1x_em committed 2025-08-11 10:03:38 +05:30
1 parent 819659c15d
commit 6e6f864382
3 files changed
+21 -9

No files matched your search

+7 -5
View File
@@ -14,7 +14,7 @@ from gi.repository import GLib
from services.battery import Battery
class EnergyModeButton(CenterBox):
class EnergyModeButton(Box):
def __init__(
self,
profile_name: str,
@@ -57,12 +57,13 @@ class EnergyModeButton(CenterBox):
self.button = Button(
child=start_box,
h_expand=True,
name="energy-mode-button-clickable",
on_clicked=self.on_clicked,
style_classes="battery-profile-button",
)
self.start_children = [self.button]
self.children = [self.button]
self.update_state()
def on_clicked(self, *args):
@@ -85,9 +86,9 @@ class EnergyModeButton(CenterBox):
self.mode_icon.remove_style_class("connected")
class GameModeButton(CenterBox):
class GameModeButton(Box):
def __init__(self, parent, **kwargs):
super().__init__(name="game-mode-button", **kwargs)
super().__init__(name="game-mode-button", h_expand=True, **kwargs)
self.parent = parent
self.game_icon = Image(
@@ -114,10 +115,11 @@ class GameModeButton(CenterBox):
child=start_box,
name="game-mode-button-clickable",
on_clicked=self.on_clicked,
h_expand=True,
style_classes="battery-gamemode-button",
)
self.start_children = [self.button]
self.children = [self.button]
self.update_state()
def on_clicked(self, *args):
+6 -3
View File
@@ -21,7 +21,7 @@ gi.require_version("Gdk", "3.0")
class BluetoothDeviceSlot(CenterBox):
def __init__(self, device: BluetoothDevice, **kwargs):
super().__init__(**kwargs)
super().__init__(h_expand=True, name="device-button", **kwargs)
self.device = device
self.device.connect("changed", self.on_changed)
self.device.connect(
@@ -42,10 +42,13 @@ class BluetoothDeviceSlot(CenterBox):
self.start_children = [
Button(
image=self.dimage,
on_clicked=lambda *_: self.toggle_connecting(),
child=Box(
orientation="h",
h_expand=True,
children=[self.dimage, Label(label=device.name)],
), # type: ignore
),
Label(label=device.name), # type: ignore
]
# Add battery info if available
+8 -1
View File
@@ -879,7 +879,7 @@
border: none;
padding: 8px 12px;
border-radius: 8px;
transition: background-color 0.2s ease;
/* transition: background-color 0.2s ease; */
}
#wifi-other-button:hover {
@@ -890,3 +890,10 @@
font-size: 14px;
font-weight: 500;
}
#device-button {
/* background-color: #000; */
}
#device-button.button:hover {
background-color: rgba(255, 255, 255, 0.1);
}