aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-10 04:26:58 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-03-10 04:51:20 +0100
commite88f9bb28500bdf2bfe5106b565ab56a0b601239 (patch)
treec96410b63d2c63f42ab945b01d2d1b811bebbc5a /src/interface-gtk.h
parent1d26dd19d09bf1fb764d1c5bef54eb05d1f4c2df (diff)
downloadsciteco-e88f9bb28500bdf2bfe5106b565ab56a0b601239.tar.gz
avoid frequent info line redraws in Curses and GTK+ UIs
* it is now redrawn once after each key press, even if the info line has not changed. * This is because Interface::update_info() is called very often in interactive mode, so it makes more sense to redraw it after user interaction (where even unnecessary delays are not noticed so easily), than thousands of times in a macro. * This is especially important since InterfaceCurses::update_info() now also sets the Window title on PDCurses - this is a very costly operation. * The same optimization was applied to InterfaceGtk where it is probably greatly responsible for the sluggishness of the UI. The GTK+ changes are currently UNTESTED.
Diffstat (limited to 'src/interface-gtk.h')
-rw-r--r--src/interface-gtk.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/interface-gtk.h b/src/interface-gtk.h
index 4afac2f..389b096 100644
--- a/src/interface-gtk.h
+++ b/src/interface-gtk.h
@@ -67,8 +67,12 @@ public:
typedef class InterfaceGtk : public Interface<InterfaceGtk, ViewGtk> {
GtkWidget *window;
GtkWidget *vbox;
+
+ gchar *info_current;
+ GtkWidget *info_widget;
+
+ GtkWidget *message_widget;
GtkWidget *cmdline_widget;
- GtkWidget *info_widget, *message_widget;
GtkWidget *popup_widget;
@@ -78,8 +82,9 @@ public:
InterfaceGtk() : Interface(),
window(NULL),
vbox(NULL),
+ info_current(NULL), info_widget(NULL),
+ message_widget(NULL),
cmdline_widget(NULL),
- info_widget(NULL), message_widget(NULL),
popup_widget(NULL),
current_view_widget(NULL) {}
~InterfaceGtk();
@@ -140,6 +145,9 @@ private:
static void widget_set_font(GtkWidget *widget, const gchar *font_name);
void cmdline_insert_chr(gint &pos, gchar chr);
+
+ friend static inline void handle_key_press(bool is_shift, bool is_ctl,
+ guint keyval);
} InterfaceCurrent;
} /* namespace SciTECO */