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
This commit is contained in:
Daniel Johnson 2023-10-31 19:20:24 -04:00
parent b9eeda1a19
commit b77cf2dc25

View file

@ -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()))