generated from itdominator/Python-With-Gtk-Template
File widget change file delete cleanup; icon size changes
This commit is contained in:
parent
f708dedd2b
commit
a0d5225286
@ -102,7 +102,7 @@ class FileWidget(WidgetSaveLoadController, Gtk.Box):
|
||||
def _load_widgets(self):
|
||||
box = Gtk.Box()
|
||||
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)
|
||||
|
||||
box.set_orientation(1)
|
||||
@ -117,9 +117,8 @@ class FileWidget(WidgetSaveLoadController, Gtk.Box):
|
||||
|
||||
def _key_released(self, widget = None, eve = None):
|
||||
if eve.type == 9:
|
||||
# if enter or spacebar:
|
||||
# pass
|
||||
...
|
||||
if eve.keyval in [32, 65293]:
|
||||
event_system.emit("open_files", ( [self.get_file_path()], ) )
|
||||
|
||||
def _clicked(self, widget = None, eve = None):
|
||||
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()
|
||||
|
||||
if len(uris) == 1:
|
||||
try:
|
||||
self.delete_cleanup()
|
||||
except Exception as e:
|
||||
...
|
||||
|
||||
self.set_file_path(uris[0])
|
||||
|
||||
dlg.destroy()
|
||||
|
@ -46,12 +46,12 @@ class Sections(Gtk.Notebook):
|
||||
search.connect("changed", self._text_search)
|
||||
|
||||
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.connect("released", self.create_section_view)
|
||||
|
||||
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.connect("released", self.show_io_collection)
|
||||
|
||||
@ -59,7 +59,7 @@ class Sections(Gtk.Notebook):
|
||||
io_popup.set_relative_to(io_btn)
|
||||
|
||||
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.connect("released", self.show_widgets_selection)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user