Hello community, here is the log from the commit of package girara for openSUSE:Factory checked in at 2016-10-20 23:09:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/girara (Old) and /work/SRC/openSUSE:Factory/.girara.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "girara" Changes: -------- --- /work/SRC/openSUSE:Factory/girara/girara.changes 2016-06-03 16:39:18.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.girara.new/girara.changes 2016-10-20 23:09:54.000000000 +0200 @@ -1,0 +2,10 @@ +Mon Oct 17 11:00:08 UTC 2016 - [email protected] + +- Update rpm group; trim description + +------------------------------------------------------------------- +Thu Oct 13 06:56:24 UTC 2016 - [email protected] + +- add girara-font-handling.patch -- fix for gtk-3.21+ compaktibility + +------------------------------------------------------------------- New: ---- girara-font-handling.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ girara.spec ++++++ --- /var/tmp/diff_new_pack.YDymWJ/_old 2016-10-20 23:09:55.000000000 +0200 +++ /var/tmp/diff_new_pack.YDymWJ/_new 2016-10-20 23:09:55.000000000 +0200 @@ -21,25 +21,22 @@ Name: girara Version: 0.2.6 Release: 0 -Summary: User interface library +Summary: Graphical user interface library License: Zlib -Group: Libraries +Group: Development/Libraries/C and C++ Url: http://pwmt.org/projects/girara Source0: http://pwmt.org/projects/girara/download/%{name}-%{version}.tar.gz +Patch0: girara-font-handling.patch BuildRequires: gettext BuildRequires: pkgconfig BuildRequires: pkgconfig(gtk+-3.0) >= 3.2 BuildRequires: pkgconfig(libnotify) BuildRoot: %{_tmppath}/%{name}-%{version}-build -%package -n %{libname}-%{so_ver} -Summary: Header files for girara library -Group: System/Libraries - -%description -n %{libname}-%{so_ver} +%description girara is a library that implements a user interface that focuses on -simplicity and minimalism. Currently based on GTK+, a cross-platform -widget toolkit, it provides an interface that focuses on three main +simplicity and minimalism. Currently based on GTK+, +it provides an interface that focuses on three main components: A so-called view widget that represents the actual application (e.g. a website (browser), an image (image viewer) or the document (document viewer)), an input bar that is used to execute @@ -48,10 +45,14 @@ the user interface that is used by zathura and jumanji and other features that those applications share. -%description +%package -n %{libname}-%{so_ver} +Summary: A graphical user interface library +Group: System/Libraries + +%description -n %{libname}-%{so_ver} girara is a library that implements a user interface that focuses on -simplicity and minimalism. Currently based on GTK+, a cross-platform -widget toolkit, it provides an interface that focuses on three main +simplicity and minimalism. Currently based on GTK+, +it provides an interface that focuses on three main components: A so-called view widget that represents the actual application (e.g. a website (browser), an image (image viewer) or the document (document viewer)), an input bar that is used to execute @@ -61,15 +62,16 @@ features that those applications share. %package devel -Summary: Header files for girara library -Group: Development/Libraries +Summary: Header files for the girara library +Group: Development/Libraries/C and C++ Requires: %{libname}-%{so_ver} = %{version}-%{release} %description devel -Header files for girara user interface library. +Header files for the girara user interface library. %prep %setup -q +%patch0 -p1 %build make %{?_smp_mflags} COLOR=0 VERBOSE=1 ++++++ girara-font-handling.patch ++++++ >From 949c879aa84e9496fabc7d3602060e29f9dc42a1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher <[email protected]> Date: Sat, 3 Sep 2016 11:54:53 +0200 Subject: [PATCH] Update font handling for changes in Gtk+ 3.21 Signed-off-by: Sebastian Ramacher <[email protected]> --- data/girara-post-3.20.css_t | 11 ++++++++++- girara/config.c | 3 +-- girara/internal.h | 2 ++ girara/session.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 103 insertions(+), 6 deletions(-) Index: girara-0.2.6/data/girara-post-3.20.css_t =================================================================== --- girara-0.2.6.orig/data/girara-post-3.20.css_t +++ girara-0.2.6/data/girara-post-3.20.css_t @@ -9,7 +9,15 @@ color: @default-fg@; background-color: @default-bg@; background-image: none; - font: @font@; + font-family: @font-family@; + font-size: @font-size@; + font-weight: @font-weight@; + box-shadow: none; + border-style: none; + margin: 0px; + padding: @bottombox-padding1@px @bottombox-padding2@px @bottombox-padding3@px + @bottombox-padding4@px; + } /* Inputbar */ @@ -111,4 +119,5 @@ #@session@ scrolledwindow overshoot.right, #@session@ scrolledwindow overshoot.right:backdrop { background-color: transparent; + background-image: none; } Index: girara-0.2.6/girara/config.c =================================================================== --- girara-0.2.6.orig/girara/config.c +++ girara-0.2.6/girara/config.c @@ -50,8 +50,7 @@ cb_font(girara_session_t* session, const { g_return_if_fail(session != NULL && value != NULL); - girara_template_set_variable_value(session->private_data->csstemplate, "font", - value); + css_template_fill_font(session->private_data->csstemplate, value); } static void Index: girara-0.2.6/girara/internal.h =================================================================== --- girara-0.2.6.orig/girara/internal.h +++ girara-0.2.6/girara/internal.h @@ -148,6 +148,8 @@ HIDDEN bool girara_cmd_dump_config(girar HIDDEN bool girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t); +HIDDEN void css_template_fill_font(GiraraTemplate* csstemplate, const char* font); + /** * Structure of a command */ Index: girara-0.2.6/girara/session.c =================================================================== --- girara-0.2.6.orig/girara/session.c +++ girara-0.2.6/girara/session.c @@ -44,7 +44,6 @@ init_template_engine(GiraraTemplate* css { static const char* variable_names[] = { "session", - "font", "default-fg", "default-bg", "inputbar-fg", @@ -78,6 +77,88 @@ init_template_engine(GiraraTemplate* css for (size_t idx = 0; idx < LENGTH(variable_names); ++idx) { girara_template_add_variable(csstemplate, variable_names[idx]); } + + if (gtk_check_version(3, 20, 0) == NULL) { + girara_template_add_variable(csstemplate, "font-family"); + girara_template_add_variable(csstemplate, "font-size"); + girara_template_add_variable(csstemplate, "font-weight"); + } else { + girara_template_add_variable(csstemplate, "font"); + } +} + +void +css_template_fill_font(GiraraTemplate* csstemplate, const char* font) +{ + if (gtk_check_version(3, 20, 0) != NULL) { + girara_template_set_variable_value(csstemplate, "font", font); + return; + } + + PangoFontDescription* descr = pango_font_description_from_string(font); + if (descr == NULL) { + return; + } + + girara_template_set_variable_value(csstemplate, "font-family", + pango_font_description_get_family(descr)); + + char* size = g_strdup_printf("%d%s", pango_font_description_get_size(descr) / PANGO_SCALE, + pango_font_description_get_size_is_absolute(descr) == FALSE ? "pt" : ""); + girara_template_set_variable_value(csstemplate, "font-size", size); + g_free(size); + + switch (pango_font_description_get_weight(descr)) { + case PANGO_WEIGHT_THIN: + girara_template_set_variable_value(csstemplate, "font-weight", "thin"); + break; + + case PANGO_WEIGHT_ULTRALIGHT: + girara_template_set_variable_value(csstemplate, "font-weight", "ultralight"); + break; + + case PANGO_WEIGHT_SEMILIGHT: + girara_template_set_variable_value(csstemplate, "font-weight", "light"); + break; + + case PANGO_WEIGHT_LIGHT: + girara_template_set_variable_value(csstemplate, "font-weight", "light"); + break; + + case PANGO_WEIGHT_BOOK: + girara_template_set_variable_value(csstemplate, "font-weight", "book"); + break; + + case PANGO_WEIGHT_MEDIUM: + girara_template_set_variable_value(csstemplate, "font-weight", "medium"); + break; + + case PANGO_WEIGHT_SEMIBOLD: + girara_template_set_variable_value(csstemplate, "font-weight", "semibold"); + break; + + case PANGO_WEIGHT_BOLD: + girara_template_set_variable_value(csstemplate, "font-weight", "bold"); + break; + + case PANGO_WEIGHT_ULTRABOLD: + girara_template_set_variable_value(csstemplate, "font-weight", "ultrabold"); + break; + + case PANGO_WEIGHT_HEAVY: + girara_template_set_variable_value(csstemplate, "font-weight", "heavy"); + break; + + case PANGO_WEIGHT_ULTRAHEAVY: + girara_template_set_variable_value(csstemplate, "font-weight", "ultraheavy"); + break; + + default: + girara_template_set_variable_value(csstemplate, "font-weight", "normal"); + break; + } + + pango_font_description_free(descr); } static void @@ -91,10 +172,16 @@ fill_template_with_values(girara_session char* font = NULL; girara_setting_get(session, "font", &font); if (font != NULL) { - girara_template_set_variable_value(csstemplate, "font", font); + css_template_fill_font(csstemplate, font); g_free(font); } else { - girara_template_set_variable_value(csstemplate, "font", "monospace normal 9"); + if (gtk_check_version(3, 20, 0) == NULL) { + girara_template_set_variable_value(csstemplate, "font-family", "monospace"); + girara_template_set_variable_value(csstemplate, "font-size", "9pt"); + girara_template_set_variable_value(csstemplate, "font-weight", "normal"); + } else { + girara_template_set_variable_value(csstemplate, "font", "monospace normal 9"); + } }; /* parse color values */
