diff options
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | example_svterc | 3 | ||||
| -rw-r--r-- | svte.c | 28 | 
4 files changed, 32 insertions, 5 deletions
| @@ -43,13 +43,13 @@ svte: ${OBJ}  clean:  	@echo cleaning -	@rm -f svte ${OBJ} mt-${VERSION}.tar.gz +	@rm -f svte ${OBJ} svte-${VERSION}.tar.gz  dist: clean  	@echo creating dist tarball  	@mkdir -p svte-${VERSION}  	@cp -R Makefile config.mk ${SRC} svte-${VERSION} -	@tar -cf svte-${VERSION}.tar mt-${VERSION} +	@tar -cf svte-${VERSION}.tar svte-${VERSION}  	@gzip svte-${VERSION}.tar  	@rm -rf svte-${VERSION} @@ -17,7 +17,7 @@  # along with this program.  If not, see <http://www.gnu.org/licenses/>.  # svte version: -VERSION = 0.1.4.1 +VERSION = 0.1.4.2  # Customize below to fit your system diff --git a/example_svterc b/example_svterc index 36a4649..2447cdd 100644 --- a/example_svterc +++ b/example_svterc @@ -46,6 +46,9 @@ url_regex=(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*  # true to enable a visible bell, false to disable it.  visible_bell=true +# set to false if you do not want to see the tab bar even with multiple tabs. +show_tabbar=true +  # Initial window height in pixels.  window_height=500 @@ -51,6 +51,7 @@ typedef struct {    gdouble bg_saturation;    gchar *bg_image;    gchar *url_regex; +  gboolean show_tabbar;    gboolean visible_bell;    gint window_height;    gint window_width; @@ -76,6 +77,7 @@ static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page,      guint page_num, struct window *w);  static void set_window_title(term *t);  static void launch_url(char *url); +static void zoom(gboolean b, struct term *t);  static inline term* get_current_term(window *w);  static inline term* get_nth_term(window *w, guint page); @@ -122,6 +124,17 @@ static void launch_url(char *url) {    g_spawn_command_line_async(g_strconcat(config->browser_command, " ", url, NULL), NULL);	  } +static void zoom(gboolean b, struct term *t) { + +  int size = -2000; +  if(b)  +    size = 2000; +  PangoFontDescription *font = vte_terminal_get_font(VTE_TERMINAL(t->vte)); +  pango_font_description_set_size(font, pango_font_description_get_size(font) + size); +  vte_terminal_set_font(VTE_TERMINAL(t->vte), font); + +} +  /* key event handler */  gboolean event_key(GtkWidget *widget, GdkEventKey *event, window *w) { @@ -148,6 +161,14 @@ gboolean event_key(GtkWidget *widget, GdkEventKey *event, window *w) {        vte_terminal_paste_clipboard(VTE_TERMINAL(get_current_term(w)->vte));        return TRUE;      } +    if (g == GDK_plus) { +      zoom(TRUE, get_current_term(w)); +      return TRUE; +    } +    if (g == GDK_underscore) { +      zoom(FALSE, get_current_term(w)); +      return TRUE; +    }      if (g == GDK_C) {        vte_terminal_copy_clipboard(VTE_TERMINAL(get_current_term(w)->vte));        return TRUE; @@ -173,7 +194,7 @@ gboolean event_key(GtkWidget *widget, GdkEventKey *event, window *w) {        return TRUE;      }    } -     +    if(g == GDK_KEY_Forward) {      tab_switch(TRUE, w);      return  TRUE; @@ -398,7 +419,8 @@ static void tab_new(struct window *w) {      vte_terminal_fork_command_full(VTE_TERMINAL(t->vte),           VTE_PTY_DEFAULT, tab_get_cwd(previous),           args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &t->pid, NULL); -    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(w->notebook), TRUE); +    if(config->show_tabbar == TRUE) +      gtk_notebook_set_show_tabs(GTK_NOTEBOOK(w->notebook), TRUE);    }    g_object_set_qdata_full(G_OBJECT(gtk_notebook_get_nth_page( @@ -536,6 +558,8 @@ static void parse_config_file(gchar *config_file) {        keyfile, "ui", "bg_saturation", NULL);    config->url_regex = g_key_file_get_string(        keyfile, "ui", "url_regex", NULL); +  config->show_tabbar = g_key_file_get_boolean( +      keyfile, "ui", "show_tabbar", NULL);    config->visible_bell = g_key_file_get_boolean(        keyfile, "ui", "visible_bell", NULL);    config->window_height = g_key_file_get_integer( | 
