refactor(controlcenter): remove animation effects and adjust visibility logic
This commit is contained in:
2 files changed
+15
-11
No files matched your search
@@ -259,16 +259,13 @@ class BluetoothDeviceSlot(CenterBox):
|
|||||||
|
|
||||||
if state == BTState.CONNECTED:
|
if state == BTState.CONNECTED:
|
||||||
self.add_style_class("active")
|
self.add_style_class("active")
|
||||||
self.status_icon.set_visible(True)
|
self.status_icon.set_visible(False)
|
||||||
self.status_icon.set_from_icon_name("emblem-ok-symbolic", 5)
|
|
||||||
elif state == BTState.CONNECTING:
|
elif state == BTState.CONNECTING:
|
||||||
self.add_style_class("connecting")
|
self.add_style_class("connecting")
|
||||||
self.status_icon.set_visible(True)
|
self.status_icon.set_visible(False)
|
||||||
self.status_icon.set_from_icon_name("process-working-symbolic", 5)
|
|
||||||
elif state == BTState.FAILED:
|
elif state == BTState.FAILED:
|
||||||
self.add_style_class("failed")
|
self.add_style_class("failed")
|
||||||
self.status_icon.set_visible(True)
|
self.status_icon.set_visible(False)
|
||||||
self.status_icon.set_from_icon_name("dialog-error-symbolic", 5)
|
|
||||||
GLib.timeout_add(5000, self._reset_from_failed)
|
GLib.timeout_add(5000, self._reset_from_failed)
|
||||||
else:
|
else:
|
||||||
self.status_icon.set_visible(False)
|
self.status_icon.set_visible(False)
|
||||||
@@ -367,6 +364,7 @@ class BluetoothConnections(Box):
|
|||||||
max_content_size=(303, 200),
|
max_content_size=(303, 200),
|
||||||
child=self.paired_devices,
|
child=self.paired_devices,
|
||||||
overlay_scroll=True,
|
overlay_scroll=True,
|
||||||
|
animate=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.no_devices_label = Label(
|
self.no_devices_label = Label(
|
||||||
@@ -377,7 +375,10 @@ class BluetoothConnections(Box):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.other_devices_button = Button(
|
self.other_devices_button = Button(
|
||||||
child=Label("Other Devices", h_align="start"),
|
child=CenterBox(
|
||||||
|
start_children=Label("Other Devices", h_align="start"),
|
||||||
|
end_children=self.refresh_indicator,
|
||||||
|
),
|
||||||
name="wifi-other-button",
|
name="wifi-other-button",
|
||||||
on_clicked=self.toggle_other_devices,
|
on_clicked=self.toggle_other_devices,
|
||||||
)
|
)
|
||||||
@@ -388,6 +389,7 @@ class BluetoothConnections(Box):
|
|||||||
max_content_size=(303, 300),
|
max_content_size=(303, 300),
|
||||||
child=self.other_devices,
|
child=self.other_devices,
|
||||||
overlay_scroll=True,
|
overlay_scroll=True,
|
||||||
|
animate=False,
|
||||||
)
|
)
|
||||||
self.other_devices.set_visible(False)
|
self.other_devices.set_visible(False)
|
||||||
|
|
||||||
@@ -406,7 +408,6 @@ class BluetoothConnections(Box):
|
|||||||
end_children=self.toggle_button,
|
end_children=self.toggle_button,
|
||||||
name="bluetooth-widget-top",
|
name="bluetooth-widget-top",
|
||||||
),
|
),
|
||||||
self.refresh_indicator,
|
|
||||||
Separator(orientation="h", name="separator"),
|
Separator(orientation="h", name="separator"),
|
||||||
self.paired_devices_label,
|
self.paired_devices_label,
|
||||||
self.paired_devices_scrolled,
|
self.paired_devices_scrolled,
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ class WifiConnections(Box):
|
|||||||
max_content_size=(303, 200),
|
max_content_size=(303, 200),
|
||||||
child=self.known_networks,
|
child=self.known_networks,
|
||||||
overlay_scroll=True,
|
overlay_scroll=True,
|
||||||
|
animate=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create "No networks available" message
|
# Create "No networks available" message
|
||||||
@@ -335,9 +336,11 @@ class WifiConnections(Box):
|
|||||||
visible=False,
|
visible=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create Other Networks section with clickable title
|
|
||||||
self.other_networks_button = Button(
|
self.other_networks_button = Button(
|
||||||
child=Label("Other Networks", h_align="start"),
|
child=CenterBox(
|
||||||
|
start_children=Label("Other Networks", h_align="start"),
|
||||||
|
end_children=self.refresh_indicator,
|
||||||
|
),
|
||||||
name="wifi-other-button",
|
name="wifi-other-button",
|
||||||
on_clicked=self.toggle_other_networks,
|
on_clicked=self.toggle_other_networks,
|
||||||
)
|
)
|
||||||
@@ -349,6 +352,7 @@ class WifiConnections(Box):
|
|||||||
max_content_size=(303, 300),
|
max_content_size=(303, 300),
|
||||||
child=self.other_networks,
|
child=self.other_networks,
|
||||||
overlay_scroll=True,
|
overlay_scroll=True,
|
||||||
|
animate=False,
|
||||||
)
|
)
|
||||||
self.other_networks.set_visible(False)
|
self.other_networks.set_visible(False)
|
||||||
|
|
||||||
@@ -368,7 +372,6 @@ class WifiConnections(Box):
|
|||||||
end_children=self.toggle_button,
|
end_children=self.toggle_button,
|
||||||
name="wifi-widget-top",
|
name="wifi-widget-top",
|
||||||
),
|
),
|
||||||
self.refresh_indicator,
|
|
||||||
Separator(orientation="h", name="separator"),
|
Separator(orientation="h", name="separator"),
|
||||||
self.known_networks_label,
|
self.known_networks_label,
|
||||||
self.known_networks_scrolled,
|
self.known_networks_scrolled,
|
||||||
|
|||||||
Reference in new issue
Block a user