roundabout,
created on Monday, 22 December 2025, 21:59:26 (1766440766),
received on Monday, 22 December 2025, 21:59:30 (1766440770)
Author identity: Vlad <vlad.muntoiu@gmail.com>
4696cf4ab1189e09ae79e451ab8d6b9ffec269a4
applets/file-listing/__init__.py
@@ -31,6 +31,35 @@ locale.bindtextdomain("panorama-panel-file-listing", module_directory / "locale"
_ = lambda x: locale.dgettext("panorama-panel-file-listing", x)
@Gtk.Template(filename=str(module_directory / "panorama-panel-file-listing.ui"))
class FileListingOptions(Gtk.Window):
__gtype_name__ = "FileListingOptions"
icon_size_adjustment: Gtk.Adjustment = Gtk.Template.Child()
icon_name_entry: Gtk.Entry = Gtk.Template.Child()
label_entry: Gtk.Label = Gtk.Template.Child()
hidden_button: Gtk.CheckButton = Gtk.Template.Child()
root_button: Gtk.Button = Gtk.Template.Child()
@GObject.Signal(arg_types=(str,))
def new_path(self, path):
self.root_button.set_label(path)
def open_done(self, browser, result, *args):
self.emit("new_path", browser.select_folder_finish(result).get_path())
def show_browser(self, button):
browser = Gtk.FileDialog()
browser.select_folder(self, None, self.open_done)
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.root_button.connect("clicked", self.show_browser)
self.connect("close-request", lambda *args: self.destroy())
class FileMenuAttributeIter(Gio.MenuAttributeIter, GObject.Object):
def __init__(self, attributes: dict, **kwargs):
GObject.Object.__init__(self, **kwargs)
@@ -185,8 +214,11 @@ class FileListingApplet(panorama_panel.Applet):
def __init__(self, orientation=Gtk.Orientation.HORIZONTAL, config=None, **kwargs):
super().__init__(orientation=orientation, config=config, **kwargs)
locale.bindtextdomain("panorama-panel-file-listing", module_directory / "locale")
_ = lambda x: locale.dgettext("panorama-panel-file-listing", x)
if config is None:
config = {}
self.options_window = None
self.action_group = Gio.SimpleActionGroup()
self.directory = Path(config.get("directory", "~")).expanduser().resolve()
self.button = Gtk.MenuButton()
@@ -199,8 +231,10 @@ class FileListingApplet(panorama_panel.Applet):
self.show_hidden = config.get("show_hidden", False)
self.icon_size = config.get("icon_size", 24)
self.label = config.get("label")
self.icon = None
if config.get("icon_name"):
self.inner_box.append(Gtk.Image(icon_name=config["icon_name"], pixel_size=config.get("icon_size", 24)))
self.icon = Gtk.Image(icon_name=config["icon_name"], pixel_size=config.get("icon_size", 24))
self.inner_box.append(self.icon)
if config.get("label"):
self.inner_box.append(Gtk.Label.new(config["label"]))
@@ -219,7 +253,7 @@ class FileListingApplet(panorama_panel.Applet):
self.container_menu.append_section(None, self.menu)
self.container_menu.file_list = self.menu
self.popover.set_menu_model(self.menu)
self.popover.set_menu_model(self.container_menu)
self.button.set_popover(self.popover)
panorama_panel.track_popover(self.popover)
@@ -233,8 +267,21 @@ class FileListingApplet(panorama_panel.Applet):
self.action_group.add_action(self.submenu_action)
self.insert_action_group("applet", self.action_group)
self.popover.connect("realize", lambda *args: self.menu.generate())
self.popover.connect("unrealize", lambda *args: self.menu.prune())
self.popover.connect("show", lambda *args: self.menu.generate())
self.popover.connect("hide", lambda *args: self.menu.prune())
self.context_menu = self.make_context_menu()
panorama_panel.track_popover(self.context_menu)
right_click_controller = Gtk.GestureClick()
right_click_controller.set_button(3)
right_click_controller.connect("pressed", self.show_context_menu)
self.add_controller(right_click_controller)
options_action = Gio.SimpleAction.new("options", None)
options_action.connect("activate", self.show_options)
self.action_group.add_action(options_action)
def new_action(self, action_id):
action = Gio.SimpleAction(name=f"submenu-status-{action_id.hexdigest()}", state=GLib.Variant("b", False))
@@ -258,6 +305,72 @@ class FileListingApplet(panorama_panel.Applet):
else:
action.submenu.prune()
def make_context_menu(self):
menu = Gio.Menu()
menu.append(_("File menu _options"), "applet.options")
context_menu = Gtk.PopoverMenu(menu_model=menu, has_arrow=False, halign=Gtk.Align.START, flags=Gtk.PopoverMenuFlags.NESTED)
context_menu.set_parent(self)
return context_menu
def show_context_menu(self, gesture, n_presses, x, y):
rect = Gdk.Rectangle()
rect.x = int(x)
rect.y = int(y)
rect.width = 1
rect.height = 1
self.context_menu.set_pointing_to(rect)
self.context_menu.popup()
def update_icon_size(self, adjustment, *args):
self.icon_size = int(adjustment.get_value())
if self.icon is not None:
self.icon.set_pixel_size(self.icon_size)
self.emit("config-changed")
def show_options(self, _0=None, _1=None):
if self.options_window is None:
self.options_window = FileListingOptions()
# Setting the icon size
self.options_window.icon_size_adjustment.set_value(self.icon_size)
self.options_window.icon_size_adjustment.connect("value-changed", self.update_icon_size)
def reset_window(*args):
self.options_window = None
self.options_window.connect("close-request", reset_window)
# Setting the path
self.options_window.connect("new_path", self.set_path)
self.options_window.root_button.set_label(str(self.directory))
# Setting whether to show hidden files
self.options_window.hidden_button.set_active(self.show_hidden)
self.options_window.hidden_button.connect("toggled", self.set_show_hidden)
# Setting the icon name and label
self.options_window.icon_name_entry.connect("changed", self.update_button_content)
self.options_window.label_entry.connect("changed", self.update_button_content)
self.options_window.present()
def set_path(self, options_window, path):
self.menu.root = self.directory = Path(path)
self.emit("config-changed")
def update_button_content(self, *args):
if self.options_window:
self.icon = None
icon_name = self.options_window.icon_name_entry.get_text()
label = self.options_window.label_entry.get_text()
while self.inner_box.get_first_child():
self.inner_box.remove(self.inner_box.get_first_child())
if icon_name:
self.icon = Gtk.Image(icon_name=icon_name, pixel_size=self.icon_size)
self.inner_box.append(self.icon)
if label:
self.inner_box.append(Gtk.Label.new(label))
def set_show_hidden(self, checkbutton):
self.menu.show_hidden = self.show_hidden = checkbutton.get_active()
self.emit("config-changed")
def get_config(self):
return {
"directory": str(self.directory),
applets/file-listing/locale/ro/LC_MESSAGES/panorama-panel-file-listing.mo
applets/file-listing/panorama-panel-file-listing.cmb
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
<!-- Created with Cambalache 0.96.3 -->
<cambalache-project version="0.96.0" target_tk="gtk-4.0">
<ui template-class="FileListingOptions" filename="panorama-panel-file-listing.ui" sha256="15b87b4d930d59ae42b442d375692b6f60591af4ea474810381de6b212a12252"/>
</cambalache-project>
applets/file-listing/panorama-panel-file-listing.ui
@@ -0,0 +1,176 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.96.3 -->
<interface domain="panorama-panel-file-listing">
<!-- interface-name panorama-panel-file-listing.ui -->
<requires lib="gtk" version="4.18"/>
<template class="FileListingOptions" parent="GtkWindow">
<property name="title" translatable="yes">File listing options</property>
<child>
<object class="GtkScrolledWindow">
<child>
<object class="GtkViewport">
<child>
<object class="GtkBox">
<property name="margin-bottom">32</property>
<property name="margin-end">32</property>
<property name="margin-start">32</property>
<property name="margin-top">32</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="spacing">4</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Directory to show</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkButton" id="root_button">
<property name="hexpand">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="spacing">4</property>
<child>
<object class="GtkCheckButton" id="hidden_button">
<property name="label" translatable="yes">Show hidden files</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="label-widget">
<object class="GtkLabel">
<property name="label" translatable="yes">Appearance</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</property>
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Icon size</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkScale">
<property name="adjustment">
<object class="GtkAdjustment" id="icon_size_adjustment">
<property name="lower">8.0</property>
<property name="step-increment">1.0</property>
<property name="upper">96.0</property>
<property name="value">24.0</property>
</object>
</property>
<property name="hexpand">True</property>
<marks>
<mark position="bottom" value="16.0"/>
<mark position="bottom" value="24.0"/>
<mark value="32.0"/>
<mark value="48.0"/>
<mark value="64.0"/>
<mark value="96.0"/>
</marks>
</object>
</child>
<child>
<object class="GtkSpinButton">
<property name="adjustment">icon_size_adjustment</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="spacing">4</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Icon name</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkEntry" id="icon_name_entry">
<property name="hexpand">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="spacing">4</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Label</property>
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkEntry" id="label_entry">
<property name="hexpand">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
applets/file-listing/po/messages.pot
@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-22 23:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: __init__.py:145 __init__.py:250
msgid "Open directory"
msgstr ""
#: __init__.py:214
msgid "File listing"
msgstr ""
#: __init__.py:215
msgid "View a nesting menu of your files"
msgstr ""
#: __init__.py:313
msgid "File menu _options"
msgstr ""
#: panorama-panel-file-listing.ui:7
msgid "File listing options"
msgstr ""
#: panorama-panel-file-listing.ui:32
msgid "Directory to show"
msgstr ""
#: panorama-panel-file-listing.ui:53
msgid "Show hidden files"
msgstr ""
#: panorama-panel-file-listing.ui:68
msgid "Appearance"
msgstr ""
#: panorama-panel-file-listing.ui:85
msgid "Icon size"
msgstr ""
#: panorama-panel-file-listing.ui:131
msgid "Icon name"
msgstr ""
#: panorama-panel-file-listing.ui:152
msgid "Label"
msgstr ""
applets/file-listing/po/ro.po
@@ -0,0 +1,63 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-22 23:57+0200\n"
"PO-Revision-Date: 2025-12-22 23:58+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.8\n"
#: __init__.py:145 __init__.py:250
msgid "Open directory"
msgstr "Deschide directorul"
#: __init__.py:214
msgid "File listing"
msgstr "Listă de fișiere"
#: __init__.py:215
msgid "View a nesting menu of your files"
msgstr "Vizualizați un meniu arborescent al fișierelor dumneavoastră"
#: __init__.py:313
msgid "File menu _options"
msgstr "_Opțiunile meniului de fișiere"
#: panorama-panel-file-listing.ui:7
msgid "File listing options"
msgstr "Opțiunile listei de fișiere"
#: panorama-panel-file-listing.ui:32
msgid "Directory to show"
msgstr "Directorul de afișat"
#: panorama-panel-file-listing.ui:53
msgid "Show hidden files"
msgstr "Arată și fișierele ascunse"
#: panorama-panel-file-listing.ui:68
msgid "Appearance"
msgstr "Aspect"
#: panorama-panel-file-listing.ui:85
msgid "Icon size"
msgstr "Dimensiunea iconiței"
#: panorama-panel-file-listing.ui:131
msgid "Icon name"
msgstr "Numele iconiței"
#: panorama-panel-file-listing.ui:152
msgid "Label"
msgstr "Etichetă"
applets/indicators/__init__.py
@@ -315,6 +315,7 @@ class IndicatorApplet(panorama_panel.Applet):
if isinstance(item, StatusIcon):
item.icon.set_pixel_size(self.icon_size)
item = item.get_next_sibling()
self.emit("config-changed")
def get_config(self):
return {
applets/indicators/locale/ro/LC_MESSAGES/panorama-indicator-applet.mo
applets/indicators/locale/ro_RO/LC_MESSAGES/panorama-indicator-applet.mo
applets/indicators/panorama-indicator-applet.cmb
@@ -2,5 +2,5 @@
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
<!-- Created with Cambalache 0.96.3 -->
<cambalache-project version="0.96.0" target_tk="gtk-4.0">
<ui template-class="IndicatorOptions" filename="panorama-indicator-applet.ui" sha256="b09983dfb2da883c7bb315cd5a978de96b3b3442c2f19a7b3c27017f768a122c"/>
<ui template-class="IndicatorOptions" filename="panorama-indicator-applet.ui" sha256="091a2ab68440436c80171647b68f31ae41f8c955be3f21778fd3b2e051ef7997"/>
</cambalache-project>
applets/indicators/panorama-indicator-applet.ui
@@ -16,6 +16,7 @@
<property name="margin-start">32</property>
<property name="margin-top">32</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkFrame">
<property name="label-widget">
config.yaml
@@ -69,7 +69,8 @@ panels:
icon_size: 24
low_threshold: 0.15
critical_threshold: 0.05
- ScreenBrightness: {}
- ScreenBrightness:
icon_size: 24
- Volume:
percentage_reveal: 1000
popdown_after_manual: 2000
@@ -82,7 +83,9 @@ panels:
- ClockApplet:
formatting: '%T, %a %-d %b %Y'
- SessionMenu:
lock_command: gtklock
trigger_name: system-menu
icon_name: system-shutdown-symbolic
icon_size: 24
- position: bottom
monitor: eDP-1
size: 40