mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-21 07:59:40 +01:00
prevent focus lack for main views
This commit is contained in:
@@ -1364,6 +1364,10 @@ class Application(Gtk.Application):
|
|||||||
|
|
||||||
selection = view.get_selection()
|
selection = view.get_selection()
|
||||||
model, paths = selection.get_selected_rows()
|
model, paths = selection.get_selected_rows()
|
||||||
|
if not paths:
|
||||||
|
self.show_error_message("No selected item!")
|
||||||
|
return
|
||||||
|
|
||||||
model_name = get_base_model(model).get_name()
|
model_name = get_base_model(model).get_name()
|
||||||
itrs = [model.get_iter(path) for path in paths]
|
itrs = [model.get_iter(path) for path in paths]
|
||||||
rows = [model[in_itr][:] for in_itr in itrs]
|
rows = [model[in_itr][:] for in_itr in itrs]
|
||||||
@@ -2904,6 +2908,11 @@ class Application(Gtk.Application):
|
|||||||
self.update_bouquet_list()
|
self.update_bouquet_list()
|
||||||
|
|
||||||
def on_view_focus(self, view, focus_event=None):
|
def on_view_focus(self, view, focus_event=None):
|
||||||
|
# Preventing focus lack for some cases.
|
||||||
|
if not focus_event and not view.is_focus():
|
||||||
|
view.grab_focus()
|
||||||
|
return True
|
||||||
|
|
||||||
model_name, model = get_model_data(view)
|
model_name, model = get_model_data(view)
|
||||||
not_empty = len(model) > 0 if model else False
|
not_empty = len(model) > 0 if model else False
|
||||||
is_service = model_name == self.SERVICE_MODEL
|
is_service = model_name == self.SERVICE_MODEL
|
||||||
|
|||||||
Reference in New Issue
Block a user