From b77cf2dc25c2c193440a9fea172d8e4c567dd2d8 Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Tue, 31 Oct 2023 19:20:24 -0400 Subject: [PATCH] Switch to using icons instead of text to save space. I use "..." as an icon to browse because it looks better than using text, I think. I made the icon buttons circular, because that is what Lutris usually does. This opens the folder via xdg-open which does not seem to let me select the file (if any); not sure how to do better here. The open-folder button is disable if we can't find a directory that exists to open. Resolves #5096 --- lutris/gui/widgets/common.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lutris/gui/widgets/common.py b/lutris/gui/widgets/common.py index 40e322ddf..787fc8bf0 100644 --- a/lutris/gui/widgets/common.py +++ b/lutris/gui/widgets/common.py @@ -93,10 +93,17 @@ class FileChooserEntry(Gtk.Box): self.entry.connect("focus-out-event", self.on_focus_out) self.entry.connect("backspace", self.on_backspace) - browse_button = Gtk.Button(_("Browse..."), visible=True) + browse_button = Gtk.Button.new_from_icon_name("view-more-horizontal-symbolic", Gtk.IconSize.BUTTON) + if action == Gtk.FileChooserAction.SELECT_FOLDER: + browse_button.set_tooltip_text(_("Select a folder")) + else: + browse_button.set_tooltip_text(_("Select a file")) + browse_button.get_style_context().add_class("circular") browse_button.connect("clicked", self.on_browse_clicked) - self.open_button = Gtk.Button(_("Open"), visible=True) + self.open_button = Gtk.Button.new_from_icon_name("folder-symbolic", Gtk.IconSize.BUTTON) + self.open_button.set_tooltip_text(_("Open in file browser")) + self.open_button.get_style_context().add_class("circular") self.open_button.connect("clicked", self.on_open_clicked) self.open_button.set_sensitive(bool(self.get_open_directory()))