From e26696ee728cfffac3e39f87fb65a26c85af00a0 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 11 Jul 2025 03:18:27 +0545 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(dock/indicators):?= =?UTF-8?q?=20adapt=20RecordingIndicator=20layout=20based=20on=20dock=20po?= =?UTF-8?q?sition,=20update=20time=20label=20only=20in=20horizontal=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dock/components/indicators.py | 28 +++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/modules/dock/components/indicators.py b/modules/dock/components/indicators.py index 294daca..4c5fd97 100644 --- a/modules/dock/components/indicators.py +++ b/modules/dock/components/indicators.py @@ -184,11 +184,21 @@ class RecordingIndicator(Button): self.recording_label = Label(name="recording-label", markup=icons.screenrecord) self.time_label = Label(name="recording-time-label", markup="00:00") - self.recording_box = Box( - orientation="h", - spacing=4, - children=[self.recording_label, self.time_label] - ) + # Adapt layout based on dock position + if data.VERTICAL: + # Vertical dock: show only icon + self.recording_box = Box( + orientation="v", + spacing=2, + children=[self.recording_label] + ) + else: + # Horizontal dock: place icon and time side by side + self.recording_box = Box( + orientation="h", + spacing=4, + children=[self.recording_label, self.time_label] + ) self.add(self.recording_box) self.connect("clicked", self.on_stop_recording) @@ -218,9 +228,11 @@ class RecordingIndicator(Button): elapsed_seconds = int(time.time() - self.recording_start_time) minutes = elapsed_seconds // 60 seconds = elapsed_seconds % 60 - time_text = f"{minutes:02d}:{seconds:02d}" - self.time_label.set_markup(time_text) - self.set_tooltip_text(f"Recording in progress ({time_text}) - Click to stop") + # Only update time label in horizontal mode + if not data.VERTICAL: + time_text = f"{minutes:02d}:{seconds:02d}" + self.time_label.set_markup(time_text) + self.set_tooltip_text(f"Recording in progress ({minutes:02d}:{seconds:02d}) - Click to stop") else: self.set_tooltip_text("Recording in progress - Click to stop") else: