File widget change file delete cleanup; icon size changes

This commit is contained in:
itdominator 2023-04-16 15:47:32 -05:00
parent f708dedd2b
commit a0d5225286
2 changed files with 11 additions and 7 deletions

View File

@ -102,7 +102,7 @@ class FileWidget(WidgetSaveLoadController, Gtk.Box):
def _load_widgets(self): def _load_widgets(self):
box = Gtk.Box() box = Gtk.Box()
eve_box = Gtk.EventBox() eve_box = Gtk.EventBox()
image = Gtk.Image(stock = Gtk.STOCK_FILE) image = Gtk.Image.new_from_icon_name("gtk-file", 6)
self.label = Gtk.Label(self._file_name) self.label = Gtk.Label(self._file_name)
box.set_orientation(1) box.set_orientation(1)
@ -117,9 +117,8 @@ class FileWidget(WidgetSaveLoadController, Gtk.Box):
def _key_released(self, widget = None, eve = None): def _key_released(self, widget = None, eve = None):
if eve.type == 9: if eve.type == 9:
# if enter or spacebar: if eve.keyval in [32, 65293]:
# pass event_system.emit("open_files", ( [self.get_file_path()], ) )
...
def _clicked(self, widget = None, eve = None): def _clicked(self, widget = None, eve = None):
if eve.button == 1 and eve.type == 5: # NOTE: Left dbl click if eve.button == 1 and eve.type == 5: # NOTE: Left dbl click
@ -244,6 +243,11 @@ class FileWidget(WidgetSaveLoadController, Gtk.Box):
uris = widget.get_uris() uris = widget.get_uris()
if len(uris) == 1: if len(uris) == 1:
try:
self.delete_cleanup()
except Exception as e:
...
self.set_file_path(uris[0]) self.set_file_path(uris[0])
dlg.destroy() dlg.destroy()

View File

@ -46,12 +46,12 @@ class Sections(Gtk.Notebook):
search.connect("changed", self._text_search) search.connect("changed", self._text_search)
add_btn = Gtk.Button() add_btn = Gtk.Button()
add_btn.set_image( Gtk.Image.new_from_icon_name("add", 4) ) add_btn.set_image( Gtk.Image.new_from_icon_name("add", 3) )
add_btn.set_always_show_image(True) add_btn.set_always_show_image(True)
add_btn.connect("released", self.create_section_view) add_btn.connect("released", self.create_section_view)
io_btn = Gtk.Button(label="I/O") io_btn = Gtk.Button(label="I/O")
io_btn.set_image( Gtk.Image.new_from_icon_name("gtk-stop", 4) ) io_btn.set_image( Gtk.Image.new_from_icon_name("gtk-stop", 3) )
io_btn.set_always_show_image(True) io_btn.set_always_show_image(True)
io_btn.connect("released", self.show_io_collection) io_btn.connect("released", self.show_io_collection)
@ -59,7 +59,7 @@ class Sections(Gtk.Notebook):
io_popup.set_relative_to(io_btn) io_popup.set_relative_to(io_btn)
widgets_btn = Gtk.Button() widgets_btn = Gtk.Button()
widgets_btn.set_image( Gtk.Image.new_from_icon_name("gtk-cdrom", 4) ) widgets_btn.set_image( Gtk.Image.new_from_icon_name("gtk-cdrom", 3) )
widgets_btn.set_always_show_image(True) widgets_btn.set_always_show_image(True)
widgets_btn.connect("released", self.show_widgets_selection) widgets_btn.connect("released", self.show_widgets_selection)