From fe2635a832d1960b0566f9db94ac5e58d9f52fc6 Mon Sep 17 00:00:00 2001 From: Emanuele Petriglia Date: Sat, 30 Nov 2019 14:31:01 +0100 Subject: [PATCH 1/2] Use Xfce's about dialog via libxfce4ui Signed-off-by: Emanuele Petriglia --- xfce4-panel-profiles/xfce4-panel-profiles.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xfce4-panel-profiles/xfce4-panel-profiles.py b/xfce4-panel-profiles/xfce4-panel-profiles.py index 82f8cb2..4aef3a8 100644 --- a/xfce4-panel-profiles/xfce4-panel-profiles.py +++ b/xfce4-panel-profiles/xfce4-panel-profiles.py @@ -32,8 +32,9 @@ import warnings import gi gi.require_version('Gtk', '3.0') +gi.require_version('libxfce4ui', '2.0') -from gi.repository import Gtk, GLib, Gio +from gi.repository import Gtk, GLib, Gio, libxfce4ui from panelconfig import PanelConfig @@ -302,10 +303,11 @@ class XfcePanelProfiles: Gtk.main_quit() def on_help_clicked(self, *args): - '''Navigate to the application documentation on Help click.''' - screen = self.window.get_screen() - link = "https://docs.xfce.org/apps/xfce4-panel-profiles/start" - Gtk.show_uri(screen, link, Gtk.get_current_event_time()) + '''Shows Xfce's standard help dialog.''' + libxfce4ui.dialog_show_help(parent=self.window, + component='xfce4-panel-profiles', + page='xfce4-panel-profiles', + offset=None) class PanelSaveDialog(Gtk.MessageDialog): -- 2.21.0 From 3b1a499a832830749281d9ad1ee4efe8d278ddaa Mon Sep 17 00:00:00 2001 From: Emanuele Petriglia Date: Sat, 30 Nov 2019 17:51:21 +0100 Subject: [PATCH 2/2] Use XfceTitledDialog from libxfce4ui Signed-off-by: Emanuele Petriglia --- .../xfce4-panel-profiles.glade | 92 ++----------------- xfce4-panel-profiles/xfce4-panel-profiles.py | 16 +--- 2 files changed, 9 insertions(+), 99 deletions(-) diff --git a/xfce4-panel-profiles/xfce4-panel-profiles.glade b/xfce4-panel-profiles/xfce4-panel-profiles.glade index 74966fe..ef9335b 100644 --- a/xfce4-panel-profiles/xfce4-panel-profiles.glade +++ b/xfce4-panel-profiles/xfce4-panel-profiles.glade @@ -1,7 +1,7 @@ - + @@ -12,100 +12,20 @@ - + + Panel Profiles + Backup and restore your panel configuration + dialog False 350 400 xfce4-panel - + True False vertical - - - True - False - True - False - vertical - - - xfce_header - 60 - True - False - - - True - False - True - True - - - True - False - start - 6 - 1 - 48 - xfce4-panel - 6 - - - False - True - 0 - - - - - True - False - 12 - <b><big>Panel Profiles</big></b> -Backup and restore your panel configuration - True - end - 0 - - - True - True - 1 - - - - - - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - False - True - 0 - - True diff --git a/xfce4-panel-profiles/xfce4-panel-profiles.py b/xfce4-panel-profiles/xfce4-panel-profiles.py index 4aef3a8..c1d610a 100644 --- a/xfce4-panel-profiles/xfce4-panel-profiles.py +++ b/xfce4-panel-profiles/xfce4-panel-profiles.py @@ -51,6 +51,9 @@ class XfcePanelProfiles: def __init__(self): '''Initialize the Panel Profiles application.''' + # Temporary fix: https://stackoverflow.com/a/44230815 + _ = libxfce4ui.TitledDialog() + self.builder = Gtk.Builder() self.builder.set_translation_domain('xfce4-panel-profiles') @@ -60,8 +63,6 @@ class XfcePanelProfiles: self.builder.connect_signals(self) self.window = self.builder.get_object("xfpanel_switch_window") - self.window.set_title(_("Panel Profiles")) - self.fix_xfce_header() self.load_xfconf() @@ -124,17 +125,6 @@ class XfcePanelProfiles: interface, cancellable) - def fix_xfce_header(self): - ''' Set background-color of frame to base-color to make it resemble the - XfceHeading widget ''' - self.xfce_header = self.builder.get_object("xfce_header") - entry = Gtk.Entry.new() - style = entry.get_style_context() - base_color = style.lookup_color("theme_base_color") - self.xfce_header.override_background_color(0, base_color[1]) - fg_color = style.lookup_color("theme_fg_color") - self.xfce_header.override_color(0, fg_color[1]) - def get_data_dirs(self): dirs = [] for directory in GLib.get_system_data_dirs(): -- 2.21.0