Initial New Windows
This commit is contained in:
1 parent
819659c15d
commit
6e6f864382
3 files changed
+21
-9
No files matched your search
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user