From: Daniel Carl Date: Mon, 1 Jul 2013 17:39:18 +0000 (+0200) Subject: Allow to enable/disable scrollbar to compile time. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=e530a694f8c8ba35ba2fd4b17cc331c9e239f124;p=vimb.git Allow to enable/disable scrollbar to compile time. --- diff --git a/config.mk b/config.mk index a1b1301..7bf1139 100644 --- a/config.mk +++ b/config.mk @@ -7,6 +7,12 @@ BINDIR ?= $(PREFIX)bin/ MANDIR ?= $(PREFIX)share/man/ #----------------compile options--------------------- + +# features +CPPFLAGS += -DFEATURE_COOKIE +CPPFLAGS += -DFEATURE_SEARCH_HIGHLIGHT +CPPFLAGS += -DFEATURE_NO_SCROLLBARS + LIBS = libsoup-2.4 GTK3LIBS=gtk+-3.0 webkitgtk-3.0 @@ -36,10 +42,6 @@ CFLAGS += -Wno-overlength-strings LDFLAGS += $(shell pkg-config --libs $(LIBS)) -lX11 -lXext -lm -# features -CPPFLAGS += -DFEATURE_COOKIE -CPPFLAGS += -DFEATURE_SEARCH_HIGHLIGHT - CPPFLAGS += -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_XOPEN_SOURCE=500 CPPFLAGS += -DPROJECT=\"${PROJECT}\" ifeq ($(USEGTK3), 1) diff --git a/src/main.c b/src/main.c index 733cf7f..2256675 100644 --- a/src/main.c +++ b/src/main.c @@ -660,7 +660,9 @@ static void init_core(void) /* GTK_POLICY_NEVER with gtk3 disallows window resizing and scrolling */ #ifndef HAS_GTK3 +#ifdef FEATURE_NO_SCROLLBARS gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gui->scroll), GTK_POLICY_NEVER, GTK_POLICY_NEVER); +#endif #endif /* Prepare the inputbox */ @@ -755,8 +757,6 @@ static void read_config(void) static void setup_signals() { - WebKitWebFrame *frame = webkit_web_view_get_main_frame(vb.gui.webview); - /* Set up callbacks so that if either the main window or the browser * instance is closed, the program will exit */ g_signal_connect(vb.gui.window, "destroy", G_CALLBACK(destroy_window_cb), NULL); @@ -776,8 +776,10 @@ static void setup_signals() NULL ); +#ifdef FEATURE_NO_SCROLLBARS + WebKitWebFrame *frame = webkit_web_view_get_main_frame(vb.gui.webview); g_signal_connect(G_OBJECT(frame), "scrollbars-policy-changed", G_CALLBACK(gtk_true), NULL); - +#endif g_object_connect( G_OBJECT(vb.gui.inputbox),