aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk/interface-gtk.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-02 06:10:53 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-02 06:10:53 +0100
commitf25f97e4d0d9a1da69d0ee8fc4fbdff70760f805 (patch)
tree08397c47e8f20fc081fc37810ccc0b96eabacb67 /src/interface-gtk/interface-gtk.h
parentac3d8ca27239d586d5cd7fdbfbd3ec55713ae1aa (diff)
downloadsciteco-f25f97e4d0d9a1da69d0ee8fc4fbdff70760f805.tar.gz
Gtk UI: added a GtkHeaderBar and install it as the window's title bar
* the header bar takes the role of the "info" line in the Curses UI. * even though the current file was already shown in the window title, this has certain disadvantages: * does not work well with decoration-less WMs like awesome. The file name is important information and should always be at the top of the window. The space in the task list of awesome is usually not even large enough to show the file name. * the title bar uses a canonicalized buffer/Q-Register name. For the header bar we can use custom renderings using Pango that highlight control characters just like the Curses UI does. This is currently not implemented. * An icon is now shown for the current file. This is the same icon fetching code that gtk-info-popup uses. We might want to move that code into a separate module, along with Pango rendering - Gob2 could just as well generate C++ code. * For Q-Registers, currently no icon is shown (FIXME). * Currently, the subtitle is used to indicate which type of document (buffer or q-register) is edited. This could be done using the icons only, in which case we can disable the subtitles and save screen space. * Client-side decorations are known to cause problems with some WMs and if using them fails, we end up with a titlebar and header bar. It is probably a good idea to make titlebar installation configurable, at least via a command-line switch (or perhaps ED flag?)
Diffstat (limited to 'src/interface-gtk/interface-gtk.h')
-rw-r--r--src/interface-gtk/interface-gtk.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/interface-gtk/interface-gtk.h b/src/interface-gtk/interface-gtk.h
index b5200ea..a3a0af6 100644
--- a/src/interface-gtk/interface-gtk.h
+++ b/src/interface-gtk/interface-gtk.h
@@ -78,12 +78,20 @@ typedef class InterfaceGtk : public Interface<InterfaceGtk, ViewGtk> {
GtkWidget *window;
GtkWidget *vbox;
- GtkWidget *event_box_widget;
-
+ enum {
+ INFO_TYPE_BUFFER = 0,
+ INFO_TYPE_BUFFER_DIRTY,
+ INFO_TYPE_QREGISTER
+ } info_type;
gchar *info_current;
- GtkWidget *info_widget;
+ GtkWidget *info_bar_widget;
+ GtkWidget *info_image;
+ GtkWidget *event_box_widget;
+
+ GtkWidget *message_bar_widget;
GtkWidget *message_widget;
+
GtkWidget *cmdline_widget;
GtkWidget *popup_widget;
@@ -96,9 +104,10 @@ public:
InterfaceGtk() : Interface(),
window(NULL),
vbox(NULL),
+ info_type(INFO_TYPE_BUFFER), info_current(NULL),
+ info_bar_widget(NULL), info_image(NULL),
event_box_widget(NULL),
- info_current(NULL), info_widget(NULL),
- message_widget(NULL),
+ message_bar_widget(NULL), message_widget(NULL),
cmdline_widget(NULL),
popup_widget(NULL),
current_view_widget(NULL),
@@ -163,6 +172,7 @@ public:
private:
static void widget_set_font(GtkWidget *widget, const gchar *font_name);
+ void refresh_info(void);
void cmdline_insert_chr(gint &pos, gchar chr);
} InterfaceCurrent;