Commit 6706b46a authored by Sebastian Ramacher's avatar Sebastian Ramacher

Prepare for Gtk+ 3.20 theming changes

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 31d05d30
......@@ -88,12 +88,16 @@ ${PROJECTNV}/version.h: ${PROJECTNV}/version.h.in config.mk
${PROJECTNV}/version.h.in > ${PROJECTNV}/version.h.tmp
$(QUIET)mv ${PROJECTNV}/version.h.tmp ${PROJECTNV}/version.h
${PROJECTNV}/css-definitions.c: data/girara.css_t
${PROJECTNV}/css-definitions.c: data/girara-pre-3.20.css_t
$(call colorecho,GEN,$@)
$(QUIET)echo '#include "css-definitions.h"' > $@.tmp
$(QUIET)echo 'const char* CSS_TEMPLATE =' >> $@.tmp
$(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' $< >> $@.tmp
$(QUIET)echo 'const char* CSS_TEMPLATE_PRE_3_20 =' >> $@.tmp
$(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/girara-pre-3.20.css_t >> $@.tmp
$(QUIET)echo ';' >> $@.tmp
$(QUIET)echo 'const char* CSS_TEMPLATE_POST_3_20 =' >> $@.tmp
$(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/girara-post-3.20.css_t >> $@.tmp
$(QUIET)echo ';' >> $@.tmp
$(QUIET)mv $@.tmp $@
${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk
......@@ -297,7 +301,9 @@ uninstall-headers:
# format and tidy
format:
clang-tidy -fix -checks=readability-braces-around-statements $(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
clang-tidy -fix -checks=readability-braces-around-statements \
$(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
clang-format-3.8 -i $(SOURCE) $(HEADERS)
tidy:
clang-tidy $(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
......
/* No resize grip */
#@session@ {
-GtkWindow-resize-grip-height: 0;
-GtkWindow-resize-grip-width: 0;
}
/* Hide scrollbars from GtkScrolledWindow */
#@session@ GtkScrolledWindow GtkScrollbar:insensitive {
-GtkRange-slider-width: 0;
-GtkRange-trough-border: 0;
}
#@session@ GtkScrolledWindow GtkScrollbar {
background-color: @scrollbar-bg@;
}
#@session@ GtkScrolledWindow GtkScrollbar.slider {
background-color: @scrollbar-fg@;
}
#@session@ * {
color: @default-fg@;
background-color: @default-bg@;
background-image: none;
font: @font@;
}
/* Inputbar */
#@session@ GtkEntry.inputbar {
background-color: @inputbar-bg@;
}
#@session@ .inputbar {
color: @inputbar-fg@;
background-color: @inputbar-bg@;
}
/* Completion entries and groups */
#@session@ .completion, .completion-box {
color: @completion-fg@;
background-color: @completion-bg@;
}
#@session@ .completion {
padding: 1px;
}
#@session@ .completion:selected {
color: @completion-highlight-fg@;
background-color: @completion-highlight-bg@;
}
#@session@ .completion-group {
color: @completion-group-fg@;
background-color: @completion-group-bg@;
padding: 2px 4px;
}
/* Statusbar */
#@session@ .statusbar {
color: @statusbar-fg@;
background-color: @statusbar-bg@;
}
/* Tabbar */
#@session@ .tab {
color: @tabbar-fg@;
background-color: @tabbar-bg@;
}
#@session@ GtkLabel.tab {
padding: 4px;
}
#@session@ .tab:selected {
color: @tabbar-focus-fg@;
background-color: @tabbar-focus-bg@;
}
/* Notification area */
#@session@ .notification {
color: @notification-fg@;
background-color: @notification-bg@;
}
#@session@ .notification-error {
color: @notification-error-fg@;
background-color: @notification-error-bg@;
}
#@session@ .notification-warning {
color: @notification-warning-fg@;
background-color: @notification-warning-bg@;
}
/* Padding of the bottom box */
#@session@ .bottom_box {
border-style: none;
margin: 0px;
padding: @bottombox-padding1@px @bottombox-padding2@px @bottombox-padding3@px
@bottombox-padding4@px;
}
#@session@ GtkScrolledWindow .undershoot.top,
#@session@ GtkScrolledWindow .undershoot.top:backdrop,
#@session@ GtkScrolledWindow .undershoot.bottom,
#@session@ GtkScrolledWindow .undershoot.bottom:backdrop,
#@session@ GtkScrolledWindow .undershoot.left,
#@session@ GtkScrolledWindow .undershoot.left:backdrop,
#@session@ GtkScrolledWindow .undershoot.right,
#@session@ GtkScrolledWindow .undershoot.right:backdrop {
background-color: transparent;
}
......@@ -5,6 +5,7 @@
#include "macros.h"
extern const char* CSS_TEMPLATE GIRARA_HIDDEN;
extern const char* CSS_TEMPLATE_PRE_3_20 GIRARA_HIDDEN;
extern const char* CSS_TEMPLATE_POST_3_20 GIRARA_HIDDEN;
#endif
......@@ -234,7 +234,11 @@ girara_session_create()
(girara_free_function_t) girara_setting_free);
/* CSS style provider */
session->private_data->csstemplate = girara_template_new(CSS_TEMPLATE);
if (gtk_check_version(3, 20, 0) == NULL) {
session->private_data->csstemplate = girara_template_new(CSS_TEMPLATE_PRE_3_20);
} else {
session->private_data->csstemplate = girara_template_new(CSS_TEMPLATE_POST_3_20);
}
session->private_data->gtk.cssprovider = NULL;
init_template_engine(session->private_data->csstemplate);
......
......@@ -7,7 +7,8 @@
#include "settings.h"
girara_statusbar_item_t*
girara_statusbar_item_add(girara_session_t* session, bool expand, bool fill, bool left, girara_statusbar_event_t callback)
girara_statusbar_item_add(girara_session_t* session, bool expand, bool fill,
bool left, girara_statusbar_event_t callback)
{
g_return_val_if_fail(session != NULL && session->elements.statusbar_items, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment