Introduce date display alongside time
This commit is contained in:
@@ -74,7 +74,7 @@ class ActionDispatcher:
|
||||
"/sound",
|
||||
"/audio-mode:0",
|
||||
"/cert:ignore",
|
||||
"+disp",
|
||||
# "+disp",
|
||||
"+dynamic-resolution",
|
||||
"/f"
|
||||
]
|
||||
|
||||
@@ -73,13 +73,16 @@ class UIController:
|
||||
|
||||
def _setup_clock(self):
|
||||
clock_label = self.builder.get_object("clock_label")
|
||||
date_label = self.builder.get_object("date_label")
|
||||
|
||||
def update():
|
||||
clock_label.set_text(datetime.now().strftime("%H:%M"))
|
||||
now = datetime.now()
|
||||
clock_label.set_text(now.strftime("%H:%M"))
|
||||
date_label.set_text(now.strftime("%A %d/%m/%Y"))
|
||||
return True
|
||||
|
||||
update()
|
||||
GLib.timeout_add_seconds(30, update)
|
||||
GLib.timeout_add_seconds(10, update)
|
||||
|
||||
def _initialist_power_options(self):
|
||||
btn_reboot = self.builder.get_object("btn_reboot")
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<property name="margin-start">32</property>
|
||||
<property name="margin-end">32</property>
|
||||
|
||||
<!-- Top Bar: Title & Clock -->
|
||||
<!-- Top Bar: Title, Date & Clock -->
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">0</property>
|
||||
@@ -28,6 +28,15 @@
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="date_label">
|
||||
<property name="label">Daydayday, 00/00/0000</property>
|
||||
<style>
|
||||
<class name="date-display"/>
|
||||
</style>
|
||||
<property name="xalign">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="clock_label">
|
||||
<property name="label">00:00</property>
|
||||
|
||||
Reference in New Issue
Block a user