Last active
February 11, 2024 10:11
-
-
Save luigifab/0fce786cdb93b5687069a82f490ea95e to your computer and use it in GitHub Desktop.
gtk3-classic (GTK 3.24) [gtk-3.24.40-deb.sh] & gtk4-classic (GTK 4.12) [gtk-4.12.5-deb.sh] / for Debian Testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkWindow3: restore focus on application start | |
# https://github.com/GNOME/gtk/blob/3.24.37/gtk/gtkwindow.c | |
Index: b/gtk/gtkwindow.c | |
=================================================================== | |
--- a/gtk/gtkwindow.c | |
+++ b/gtk/gtkwindow.c | |
@@ -6357,7 +6357,9 @@ gtk_window_map | |
/* inherit from transient parent, so that a dialog that is | |
* opened via keynav shows focus initially | |
*/ | |
- if (priv->transient_parent) | |
+ if (g_strcmp0 (g_getenv ("GTK_FOCUS_VISIBLE"), "1") == 0) | |
+ gtk_window_set_focus_visible (window, TRUE); | |
+ else if (priv->transient_parent) | |
gtk_window_set_focus_visible (window, gtk_window_get_focus_visible (priv->transient_parent)); | |
else | |
gtk_window_set_focus_visible (window, FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkWindow4: restore focus on application start | |
# https://github.com/GNOME/gtk/blob/4.12.3/gtk/gtkwindow.c | |
# @todo: with awf-gtk4, compared to awf-gtk3, focus is not on the first toolbar button, why? | |
Index: b/gtk/gtkwindow.c | |
=================================================================== | |
--- a/gtk/gtkwindow.c | |
+++ b/gtk/gtkwindow.c | |
@@ -4013,7 +4013,9 @@ gtk_window_map | |
/* inherit from transient parent, so that a dialog that is | |
* opened via keynav shows focus initially | |
*/ | |
- if (priv->transient_parent) | |
+ if (g_strcmp0 (g_getenv ("GTK_FOCUS_VISIBLE"), "1") == 0) | |
+ gtk_window_set_focus_visible (window, TRUE); | |
+ else if (priv->transient_parent) | |
gtk_window_set_focus_visible (window, gtk_window_get_focus_visible (priv->transient_parent)); | |
else | |
gtk_window_set_focus_visible (window, FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkNotebook3: add classes for stack widget | |
# default way: notebook header.top.bottom.left.right + notebook stack | |
# updated way: notebook header.top.bottom.left.right + notebook stack.top.bottom.left.right | |
# https://github.com/GNOME/gtk/blob/3.24.37/gtk/gtknotebook.c | |
Index: b/gtk/gtknotebook.c | |
=================================================================== | |
--- a/gtk/gtknotebook.c | |
+++ b/gtk/gtknotebook.c | |
@@ -1351,6 +1351,7 @@ gtk_notebook_init | |
gtk_notebook_draw_stack, | |
NULL, | |
NULL); | |
+ gtk_css_gadget_add_class (priv->stack_gadget, GTK_STYLE_CLASS_TOP); | |
gtk_css_gadget_set_state (priv->stack_gadget, gtk_css_node_get_state (widget_node)); | |
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), -1, priv->stack_gadget, TRUE, GTK_ALIGN_FILL); | |
@@ -7074,9 +7075,15 @@ gtk_notebook_update_tab_pos | |
for (i = 0; i < G_N_ELEMENTS (tab_pos_names); i++) | |
{ | |
if (tab_pos == i) | |
+ { | |
+ gtk_css_gadget_add_class (priv->stack_gadget, tab_pos_names[i]); | |
gtk_css_gadget_add_class (priv->header_gadget, tab_pos_names[i]); | |
+ } | |
else | |
+ { | |
+ gtk_css_gadget_remove_class (priv->stack_gadget, tab_pos_names[i]); | |
gtk_css_gadget_remove_class (priv->header_gadget, tab_pos_names[i]); | |
+ } | |
} | |
gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->gadget), priv->header_gadget); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkNotebook4: add classes for stack widget (warning! left/right not inverted in rtl with gtk4) | |
# default way: notebook header.top.bottom.left.right + notebook stack | |
# updated way: notebook header.top.bottom.left.right + notebook stack.top.bottom.left.right | |
# https://github.com/GNOME/gtk/blob/4.12.3/gtk/gtknotebook.c | |
Index: b/gtk/gtknotebook.c | |
=================================================================== | |
--- a/gtk/gtknotebook.c | |
+++ b/gtk/gtknotebook.c | |
@@ -1492,6 +1492,7 @@ gtk_notebook_init | |
gtk_widget_set_hexpand (notebook->stack_widget, TRUE); | |
gtk_widget_set_vexpand (notebook->stack_widget, TRUE); | |
gtk_widget_set_parent (notebook->stack_widget, GTK_WIDGET (notebook)); | |
+ gtk_widget_add_css_class (notebook->stack_widget, "top"); | |
dest = gtk_drop_target_new (GTK_TYPE_NOTEBOOK_PAGE, GDK_ACTION_MOVE); | |
gtk_drop_target_set_preload (dest, TRUE); | |
@@ -6214,9 +6214,15 @@ gtk_notebook_update_tab_pos | |
for (i = 0; i < G_N_ELEMENTS (tab_pos_names); i++) | |
{ | |
if (tab_pos == i) | |
+ { | |
+ gtk_widget_add_css_class (notebook->stack_widget, tab_pos_names[i]); | |
gtk_widget_add_css_class (notebook->header_widget, tab_pos_names[i]); | |
+ } | |
else | |
+ { | |
+ gtk_widget_remove_css_class (notebook->stack_widget, tab_pos_names[i]); | |
gtk_widget_remove_css_class (notebook->header_widget, tab_pos_names[i]); | |
+ } | |
} | |
layout = gtk_widget_get_layout_manager (GTK_WIDGET (notebook)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkProgressBar3: experimental and incomplete, restore the double color of the progress text | |
# default way, nodes are (one node, one color) | |
# progressbar text or progressbar > text | |
# updated way, only when GTK_PROGRESS_TEXT_INSIDE=1, nodes are (two nodes, two colors) | |
# progressbar.classic when text is displayed | |
# (start) progressbar text.progress or progressbar trough progress text.progress or progressbar > trough > progress > text.progress | |
# (end) progressbar text.trough or progressbar trough progress text.trough or progressbar > trough > progress > text.trough | |
# https://github.com/GNOME/gtk/blob/3.24.37/gtk/gtkprogressbar.c | |
# @todo: dynamic height/width of the progressbar base on text height/width, ie without css theme min-height/width | |
Index: b/gtk/gtkprogressbar.c | |
=================================================================== | |
--- a/gtk/gtkprogressbar.c | |
+++ b/gtk/gtkprogressbar.c | |
@@ -1336,11 +1336,93 @@ gtk_progress_bar_render_text | |
if (priv->ellipsize) | |
pango_layout_set_width (layout, width * PANGO_SCALE); | |
- gtk_render_layout (context, cr, x, y, layout); | |
- | |
- g_object_unref (layout); | |
- | |
- gtk_style_context_restore (context); | |
+ if (g_strcmp0 (g_getenv ("GTK_PROGRESS_TEXT_INSIDE"), "1") == 0) | |
+ { | |
+ GdkRectangle start_clip, end_clip; | |
+ GtkAllocation allocation_total, allocation_progress; | |
+ gboolean ltr = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR, rtl = !ltr; | |
+ int *baseline_total, *baseline_progress; | |
+ gtk_css_gadget_get_border_allocation (priv->gadget, &allocation_total, baseline_total); | |
+ gtk_css_gadget_get_border_allocation (priv->progress_gadget, &allocation_progress, baseline_progress); | |
+ if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) | |
+ { | |
+ if (ltr && !priv->inverted || rtl && priv->inverted) | |
+ { | |
+ start_clip.x = 0; | |
+ start_clip.y = 0; | |
+ start_clip.width = allocation_progress.width; | |
+ start_clip.height = allocation_progress.height; | |
+ end_clip.x = allocation_progress.width; | |
+ end_clip.y = 0; | |
+ end_clip.width = allocation_total.width - allocation_progress.width; | |
+ end_clip.height = allocation_total.height; | |
+ } | |
+ else | |
+ { | |
+ start_clip.x = allocation_total.width - allocation_progress.width; // ici | |
+ start_clip.y = 0; | |
+ start_clip.width = allocation_progress.width; | |
+ start_clip.height = allocation_progress.height; | |
+ end_clip.x = 0; // ici | |
+ end_clip.y = 0; | |
+ end_clip.width = allocation_total.width - allocation_progress.width; | |
+ end_clip.height = allocation_total.height; | |
+ } | |
+ } | |
+ else | |
+ { | |
+ if (ltr && !priv->inverted || rtl && !priv->inverted) | |
+ { | |
+ start_clip.x = 0; | |
+ start_clip.y = 0; | |
+ start_clip.width = allocation_progress.width; | |
+ start_clip.height = allocation_progress.height; | |
+ end_clip.x = 0; | |
+ end_clip.y = allocation_progress.height; | |
+ end_clip.width = allocation_total.width; | |
+ end_clip.height = allocation_total.height - allocation_progress.height; | |
+ } | |
+ else | |
+ { | |
+ start_clip.x = 0; | |
+ start_clip.y = allocation_total.height - allocation_progress.height; // ici | |
+ start_clip.width = allocation_progress.width; | |
+ start_clip.height = allocation_progress.height; | |
+ end_clip.x = 0; | |
+ end_clip.y = 0; // ici | |
+ end_clip.width = allocation_total.width; | |
+ end_clip.height = allocation_total.height - allocation_progress.height; | |
+ } | |
+ } | |
+ | |
+ if (start_clip.width > 0 && start_clip.height > 0) | |
+ { | |
+ cairo_save (cr); | |
+ gdk_cairo_rectangle (cr, &start_clip); | |
+ cairo_clip (cr); | |
+ gtk_style_context_add_class (context, "progress"); | |
+ gtk_render_layout (context, cr, x, y, layout); | |
+ gtk_style_context_remove_class (context, "progress"); | |
+ cairo_restore (cr); | |
+ } | |
+ if (end_clip.width > 0 && end_clip.height > 0) | |
+ { | |
+ cairo_save (cr); | |
+ gdk_cairo_rectangle (cr, &end_clip); | |
+ cairo_clip (cr); | |
+ gtk_style_context_add_class (context, "trough"); | |
+ gtk_render_layout (context, cr, x, y, layout); | |
+ gtk_style_context_remove_class (context, "trough"); | |
+ cairo_restore (cr); | |
+ } | |
+ } | |
+ else | |
+ { | |
+ gtk_render_layout (context, cr, x, y, layout); | |
+ } | |
+ | |
+ g_object_unref (layout); | |
+ gtk_style_context_restore (context); | |
return FALSE; | |
} | |
@@ -1565,22 +1605,40 @@ gtk_progress_bar_set_show_text | |
if (show_text) | |
{ | |
- priv->text_gadget = gtk_css_custom_gadget_new ("text", | |
- GTK_WIDGET (pbar), | |
- priv->gadget, | |
- priv->trough_gadget, | |
- gtk_progress_bar_measure_text, | |
- NULL, | |
- gtk_progress_bar_render_text, | |
- NULL, | |
- NULL); | |
+ if (g_strcmp0 (g_getenv ("GTK_PROGRESS_TEXT_INSIDE"), "1") == 0) | |
+ { | |
+ gtk_css_gadget_add_class (priv->gadget, "classic"); | |
+ priv->text_gadget = gtk_css_custom_gadget_new ("text", | |
+ GTK_WIDGET (pbar), | |
+ priv->progress_gadget, | |
+ NULL, | |
+ gtk_progress_bar_measure_text, | |
+ NULL, | |
+ gtk_progress_bar_render_text, | |
+ NULL, | |
+ NULL); | |
+ } | |
+ else | |
+ { | |
+ priv->text_gadget = gtk_css_custom_gadget_new ("text", | |
+ GTK_WIDGET (pbar), | |
+ priv->gadget, | |
+ priv->trough_gadget, | |
+ gtk_progress_bar_measure_text, | |
+ NULL, | |
+ gtk_progress_bar_render_text, | |
+ NULL, | |
+ NULL); | |
+ } | |
g_signal_connect (gtk_css_gadget_get_node (priv->text_gadget), "style-changed", | |
G_CALLBACK (gtk_progress_bar_text_style_changed), pbar); | |
update_node_state (pbar); | |
} | |
else | |
{ | |
+ if (g_strcmp0 (g_getenv ("GTK_PROGRESS_TEXT_INSIDE"), "1") == 0) | |
+ gtk_css_gadget_remove_class (priv->gadget, "classic"); | |
if (priv->text_gadget) | |
gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->text_gadget), NULL); | |
g_clear_object (&priv->text_gadget); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkProgressBar4: experimental and not working, try to restore the double color of the text | |
# default way, nodes are (one node, one color) | |
# progressbar text or progressbar > text | |
# updated way, only when GTK_PROGRESS_TEXT_INSIDE=1, nodes are (two nodes, two colors) | |
# progressbar.classic when text is displayed | |
# not working for now | |
# https://github.com/GNOME/gtk/blob/4.12.3/gtk/gtkprogressbar.c | |
# @todo: draw label inside progress bar... | |
# @todo: clip label... it's another way... | |
# @todo: dynamic height/width of the progressbar base on text height/width, ie without css theme min-height/width | |
Index: b/gtk/gtkprogressbar.c | |
=================================================================== | |
--- a/gtk/gtkprogressbar.c | |
+++ b/gtk/gtkprogressbar.c | |
@@ -895,12 +895,22 @@ gtk_progress_bar_set_show_text | |
"label", text, | |
"ellipsize", pbar->ellipsize, | |
NULL); | |
- gtk_widget_insert_after (pbar->label, GTK_WIDGET (pbar), NULL); | |
+ if (g_strcmp0 (g_getenv ("GTK_PROGRESS_TEXT_INSIDE"), "1") == 0) | |
+ { | |
+ gtk_widget_add_css_class (pbar, "classic"); | |
+ gtk_widget_insert_after (pbar->label, pbar->progress_widget, NULL); | |
+ } | |
+ else | |
+ { | |
+ gtk_widget_insert_after (pbar->label, GTK_WIDGET (pbar), NULL); | |
+ } | |
g_free (text); | |
} | |
else | |
{ | |
+ if (g_strcmp0 (g_getenv ("GTK_PROGRESS_TEXT_INSIDE"), "1") == 0) | |
+ gtk_widget_remove_css_class (pbar, "classic"); | |
g_clear_pointer (&pbar->label, gtk_widget_unparent); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkFileChooserWidget3: allow to use IEC units when Caja use them | |
# when GTK_USE_IEC_UNITS=1 and when IEC units is checked in Display tab of caja-file-management-properties | |
# https://github.com/GNOME/gtk/blob/3.24.41/gtk/gtkfilechooserwidget.c | |
Index: b/gtk/gtkfilechooserwidget.c | |
=================================================================== | |
--- a/gtk/gtkfilechooserwidget.c | |
+++ b/gtk/gtkfilechooserwidget.c | |
@@ -5223,6 +5223,13 @@ file_system_model_set | |
case MODEL_COL_SIZE_TEXT: | |
if (info == NULL || _gtk_file_info_consider_as_directory (info)) | |
g_value_set_string (value, NULL); | |
+ else if (g_strcmp0 (g_getenv ("GTK_USE_IEC_UNITS"), "1") == 0) { | |
+ GSettings *caja_preferences = g_settings_new("org.mate.caja.preferences"); | |
+ if (g_settings_get_boolean (caja_preferences, "use-iec-units")) // CAJA_PREFERENCES_USE_IEC_UNITS | |
+ g_value_take_string (value, g_format_size_full (g_file_info_get_size (info), G_FORMAT_SIZE_IEC_UNITS)); | |
+ else | |
+ g_value_take_string (value, g_format_size (g_file_info_get_size (info))); | |
+ } | |
else | |
g_value_take_string (value, g_format_size (g_file_info_get_size (info))); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkFileChooserWidget4: allow to use IEC units when Caja use them | |
# when GTK_USE_IEC_UNITS=1 and when IEC units is checked in Display tab of caja-file-management-properties | |
# https://github.com/GNOME/gtk/blob/4.12.5/gtk/gtkfilechooserwidget.c | |
Index: b/gtk/gtkfilechooserwidget.c | |
=================================================================== | |
--- a/gtk/gtkfilechooserwidget.c | |
+++ b/gtk/gtkfilechooserwidget.c | |
@@ -2087,7 +2087,14 @@ column_view_get_size | |
column_view_get_size (GFileInfo *info) | |
{ | |
if (info && !_gtk_file_info_consider_as_directory (info)) | |
+ { | |
+ if (g_strcmp0 (g_getenv ("GTK_USE_IEC_UNITS"), "1") == 0) { | |
+ GSettings *caja_preferences = g_settings_new("org.mate.caja.preferences"); | |
+ if (g_settings_get_boolean (caja_preferences, "use-iec-units")) // CAJA_PREFERENCES_USE_IEC_UNITS | |
+ return g_format_size_full (g_file_info_get_size (info), G_FORMAT_SIZE_IEC_UNITS); | |
+ } | |
return g_format_size (g_file_info_get_size (info)); | |
+ } | |
else | |
return NULL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# updated 11/02/2024 for Debian Testing (Trixie) | |
# https://build.opensuse.org/package/show/home:luigifab/gtk3-classic | |
cd "$(dirname "$0")" | |
if [ ! -d gtk3-classic ]; then | |
git clone https://github.com/lah7/gtk3-classic.git | |
fi | |
if [ ! -d builder ]; then | |
mkdir builder | |
fi | |
cd builder/ | |
numb=103 | |
for serie in trixie; do | |
rm -rf ${serie}/*/ ${serie}/*.dsc ${serie}/*.buildinfo ${serie}/*.changes ${serie}/*-1* | |
if [ ! -d ${serie} ]; then | |
mkdir $serie | |
fi | |
cd ${serie}/ | |
# https://packages.ubuntu.com/search?searchon=sourcenames&keywords=gtk%2B3.0 | |
# https://packages.debian.org/search?searchon=sourcenames&keywords=gtk%2B3.0 | |
echo "" | |
echo "==== ${serie}/gtk3 ==========================================" | |
echo "" | |
version=3.24.40 | |
classic=${version} | |
wget -nc http://deb.debian.org/debian/pool/main/g/gtk+3.0/gtk+3.0_${version}.orig.tar.xz | |
wget -nc http://deb.debian.org/debian/pool/main/g/gtk+3.0/gtk+3.0_${version}-2.debian.tar.xz | |
# prepare gtk3-classic | |
cp -r ../../gtk3-classic/ . | |
cd gtk3-classic/ | |
#git checkout -q $classic | |
git checkout -q master | |
git pull -q | |
cd .. | |
# extract and update data | |
tar xf gtk*.orig.tar.xz | |
mv gtk+-${version} gtk+3.0-${version} | |
cd gtk+3.0-${version} | |
tar xf ../gtk*.debian.tar.xz | |
rm debian/changelog | |
echo "gtk+3.0 (2:${version}-${numb}+${serie}) ${serie}; urgency=medium" > debian/changelog | |
echo "" >> debian/changelog | |
echo " * Rebuild gtk3 ${version} with gtk3-classic patches" >> debian/changelog | |
echo "" >> debian/changelog | |
echo " -- Fabrice Creuzot <[email protected]> Thu, 01 Feb 2024 07:57:28 +0000" >> debian/changelog | |
echo "" >> debian/changelog | |
cp ../gtk3-classic/*.patch debian/patches/ | |
cp ../gtk3-classic/*.css debian/patches/ | |
sed -i 's/env -u LD_PRELOAD xvfb-run -a dh_auto_test/#env -u LD_PRELOAD xvfb-run -a dh_auto_test/' debian/rules | |
sed -i 's/APIVER := 3/APIVER := 3\nexport DEB_BUILD_OPTIONS := nocheck/' debian/rules | |
rm debian/*symbols | |
# add patches | |
rm -f debian/patches/appearance__focus-visible.gtk3.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__focus-visible.gtk3.patch -q --output-document=debian/patches/appearance__focus-visible.gtk3.patch | |
rm -f debian/patches/appearance__notebook_stack_class.gtk3.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__notebook_stack_class.gtk3.patch -q --output-document=debian/patches/appearance__notebook_stack_class.gtk3.patch | |
rm -f debian/patches/appearance__progress_text.gtk3.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__progress_text.gtk3.patch -q --output-document=debian/patches/appearance__progress_text.gtk3.patch | |
rm -f debian/patches/consistent_file_size_units.gtk3.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/consistent_file_size_units.gtk3.patch -q --output-document=debian/patches/consistent_file_size_units.gtk3.patch | |
# update patch list | |
rm debian/patches/series | |
for file in debian/patches/*.patch; do | |
echo $(basename $file) >> debian/patches/series | |
done | |
# build packages | |
# dpkg-buildpackage -rfakeroot -b -uc -us | |
dpkg-buildpackage -us -uc -ui -d -S | |
cd .. | |
# sign packages | |
debsign *.changes | |
cd .. | |
done | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# updated 11/02/2024 for Debian Testing (Trixie) | |
# https://build.opensuse.org/package/show/home:luigifab/gtk4-classic | |
cd "$(dirname "$0")" | |
if [ ! -d builder ]; then | |
mkdir builder | |
fi | |
cd builder/ | |
numb=120 | |
for serie in trixie; do | |
rm -rf ${serie}/*/ ${serie}/*.dsc ${serie}/*.buildinfo ${serie}/*.changes ${serie}/*-1* | |
if [ ! -d ${serie} ]; then | |
mkdir $serie | |
fi | |
cd ${serie}/ | |
# https://packages.ubuntu.com/search?searchon=sourcenames&keywords=gtk4 | |
# https://packages.debian.org/search?searchon=sourcenames&keywords=gtk4 | |
echo "" | |
echo "==== ${serie}/gtk4 ==========================================" | |
echo "" | |
version=4.12.5 | |
classic=${version} | |
wget -nc http://deb.debian.org/debian/pool/main/g/gtk4/gtk4_${version}+ds.orig.tar.xz | |
wget -nc http://deb.debian.org/debian/pool/main/g/gtk4/gtk4_${version}+ds-2.debian.tar.xz | |
# extract and update data | |
cp gtk4_${version}+ds.orig.tar.xz gtk4_${version}.orig.tar.xz | |
tar xf gtk4_${version}.orig.tar.xz | |
mv gtk-${version} gtk4-${version} | |
cd gtk4-${version} | |
tar xf ../gtk*.debian.tar.xz | |
rm debian/changelog | |
echo "gtk4 (2:${version}-${numb}+${serie}) ${serie}; urgency=medium" > debian/changelog | |
echo "" >> debian/changelog | |
echo " * Rebuild gtk4 ${version} with gtk4-classic patches" >> debian/changelog | |
echo "" >> debian/changelog | |
echo " -- Fabrice Creuzot <[email protected]> Thu, 01 Feb 2024 07:57:28 +0000" >> debian/changelog | |
echo "" >> debian/changelog | |
sed -i 's/export SONAME := 1/export SONAME := 1\nexport DEB_BUILD_OPTIONS := nocheck/' debian/rules | |
# add patches | |
rm -f debian/patches/treeview__alternating_row_colours.gtk4.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/treeview__alternating_row_colours.gtk4.patch -q --output-document=debian/patches/treeview__alternating_row_colours.gtk4.patch | |
rm -f debian/patches/appearance__notebook_stack_class.gtk4.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__notebook_stack_class.gtk4.patch -q --output-document=debian/patches/appearance__notebook_stack_class.gtk4.patch | |
rm -f debian/patches/appearance__focus-visible.gtk4.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__focus-visible.gtk4.patch -q --output-document=debian/patches/appearance__focus-visible.gtk4.patch | |
rm -f debian/patches/appearance__progress_text.gtk4.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/appearance__progress_text.gtk4.patch -q --output-document=debian/patches/appearance__progress_text.gtk4.patch | |
rm -f debian/patches/consistent_file_size_units.gtk4.patch | |
wget https://gist.githubusercontent.com/luigifab/0fce786cdb93b5687069a82f490ea95e/raw/consistent_file_size_units.gtk4.patch -q --output-document=debian/patches/consistent_file_size_units.gtk4.patch | |
# update patch list | |
echo treeview__alternating_row_colours.gtk4.patch >> debian/patches/series | |
echo appearance__notebook_stack_class.gtk4.patch >> debian/patches/series | |
echo appearance__focus-visible.gtk4.patch >> debian/patches/series | |
echo appearance__progress_text.gtk4.patch >> debian/patches/series | |
echo consistent_file_size_units.gtk4.patch >> debian/patches/series | |
# build packages | |
#dpkg-buildpackage -rfakeroot -b -uc -us | |
dpkg-buildpackage -us -uc -ui -d -S | |
cd .. | |
# sign packages | |
debsign *.changes | |
cd .. | |
done | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GtkTreeView4: add classes to restore zebra striping, odd/even/sorted | |
# https://github.com/GNOME/gtk/blob/4.12.3/gtk/deprecated/gtktreeview.c | |
Index: b/gtk/deprecated/gtktreeview.c | |
=================================================================== | |
--- a/gtk/deprecated/gtktreeview.c | |
+++ b/gtk/deprecated/gtktreeview.c | |
@@ -4609,6 +4609,18 @@ gtk_tree_view_bin_snapshot | |
gtk_style_context_add_class (context, "cell"); | |
+ if (list == first_column) | |
+ gtk_style_context_add_class (context, rtl ? "last" : "first"); | |
+ if (list == last_column) | |
+ gtk_style_context_add_class (context, rtl ? "first" : "last"); | |
+ if (gtk_tree_rbtree_node_get_index (tree, node) % 2 == 0) | |
+ gtk_style_context_add_class (context, "odd"); | |
+ else | |
+ gtk_style_context_add_class (context, "even"); | |
+ | |
+ if (flags & GTK_CELL_RENDERER_SORTED) | |
+ gtk_style_context_add_class (context, "sorted"); | |
+ | |
if (node == priv->cursor_node && has_can_focus_cell | |
&& ((column == priv->focus_column | |
&& priv->draw_keyfocus && |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment