From 504fe8c843caf94bd06711b69434bc32d067511b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Mon, 25 May 2020 13:42:50 +0200 Subject: [PATCH 01/26] Now the ttk::entry is drawn just like expected ! With it's background of the right color ! --- generic/gtkTtk_Entry.cpp | 6 ++++-- generic/gtkTtk_Utilities.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/generic/gtkTtk_Entry.cpp b/generic/gtkTtk_Entry.cpp index 05e3b3f..383f9eb 100644 --- a/generic/gtkTtk_Entry.cpp +++ b/generic/gtkTtk_Entry.cpp @@ -70,9 +70,11 @@ static void EntryFieldElementDraw( GTKTTK_STYLE_FROM_WIDGET; GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_ENTRY|GTKTTK_SECTION_ALL); + GtkTtk_gtk_paint_flat_box(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, + "entry_bg", 0, 0, b.width, b.height); GTKTTK_WIDGET_SET_FOCUS(widget); - GtkTtk_gtk_paint_shadow(style, gdkDrawable, gtkState, gtkShadow, NULL, - widget, "entry", 0, 0, b.width, b.height); + GtkTtk_gtk_paint_shadow(style, gdkDrawable, gtkState, gtkShadow, NULL, + widget, "entry", 0, 0, b.width, b.height); } // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_CopyGtkPixmapOnToDrawable(gdkDrawable, d, tkwin, diff --git a/generic/gtkTtk_Utilities.cpp b/generic/gtkTtk_Utilities.cpp index 19224f3..6e47ba1 100644 --- a/generic/gtkTtk_Utilities.cpp +++ b/generic/gtkTtk_Utilities.cpp @@ -458,11 +458,14 @@ unsigned int GtkTtk_StateShadowTableLookup(GtkTtk_StateTable *map, gtkShadow = GTK_SHADOW_IN; } else { gtkShadow = GTK_SHADOW_OUT; - // if (state & TTK_STATE_DISABLED || state & TTK_STATE_READONLY) - // gtkState = GTK_STATE_INSENSITIVE; + if (state & TTK_STATE_DISABLED || state & TTK_STATE_READONLY) + gtkState = GTK_STATE_INSENSITIVE; // else if (state & TTK_STATE_ACTIVE) gtkState = GTK_STATE_PRELIGHT; // else if (state & TTK_STATE_FOCUS) gtkState = GTK_STATE_ACTIVE; } + if (section & GTKTTK_SECTION_ENTRY) { + if (state & TTK_STATE_FOCUS) gtkState = GTK_STATE_ACTIVE; + } if ((state & TTK_STATE_ACTIVE) && (!(state & TTK_STATE_PRESSED) && !(state & TTK_STATE_SELECTED))) { gtkState = GTK_STATE_PRELIGHT; From 7c5fbfab2e19ad1271818cc66af3ad9080b51829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Mon, 25 May 2020 13:45:43 +0200 Subject: [PATCH 02/26] Upgrade version to 0.6 now that the entry widget is corrected. --- CMakeLists.txt | 2 +- library/pkgIndex.tcl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a43cedc..aa87021 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT ( gtkTtk ) ## Package version information. SET ( PKG_NAME ${PROJECT_NAME} ) SET ( PKG_MAJOR_VERSION 0 ) -SET ( PKG_MINOR_VERSION 5 ) +SET ( PKG_MINOR_VERSION 6 ) SET ( PKG_BUILD_VERSION 0 ) SET ( PKG_VERSION "${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" ) diff --git a/library/pkgIndex.tcl b/library/pkgIndex.tcl index 381e000..32ba9a0 100644 --- a/library/pkgIndex.tcl +++ b/library/pkgIndex.tcl @@ -1,2 +1,2 @@ -package ifneeded ttk::theme::gtkTtk 0.5 \ - [list load [file join $dir libgtkTtk0.5[info sharedlibextension]] gtkTtk] \ No newline at end of file +package ifneeded ttk::theme::gtkTtk 0.6 \ + [list load [file join $dir libgtkTtk0.6[info sharedlibextension]] gtkTtk] \ No newline at end of file From 46b325667740300a4665efaf7eb16fa35137e9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 14 Jul 2020 17:16:06 +0200 Subject: [PATCH 03/26] For working on Ubuntu, add the X11 libs --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa87021..225e84d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,7 +116,6 @@ IF ( LOAD_GTK_DYNAMICALLY ) ENDIF ( LOAD_GTK_DYNAMICALLY ) IF ( CMAKE_BUILD_TYPE STREQUAL Debug ) ADD_DEFINITIONS ( -DGTKTTK_SYNCHRONIZE ) - ADD_DEFINITIONS ( -DGTKTTK_VERBOSE_XERROR_HANDLER ) ENDIF ( CMAKE_BUILD_TYPE STREQUAL Debug ) ADD_DEFINITIONS ( -DGTKTTK_INSTALL_XERROR_HANDLER ) ADD_DEFINITIONS ( -DUSE_TCL_STUBS ) @@ -191,6 +190,9 @@ MESSAGE ( STATUS "===========================================================" ) ADD_LIBRARY ( ${PKG_TARGET_LIB_NAME} SHARED ${PKG_SOURCES} ) TARGET_LINK_LIBRARIES ( ${PKG_TARGET_LIB_NAME} ${TCL_STUB_LIBRARY} ) TARGET_LINK_LIBRARIES ( ${PKG_TARGET_LIB_NAME} ${TK_STUB_LIBRARY} ) + +find_package(X11 REQUIRED) +TARGET_LINK_LIBRARIES ( ${PKG_TARGET_LIB_NAME} ${X11_X11_LIB} ) IF ( TTK_STUB_LIBRARY ) TARGET_LINK_LIBRARIES ( ${PKG_TARGET_LIB_NAME} ${TTK_STUB_LIBRARY} ) ENDIF ( TTK_STUB_LIBRARY ) From ac3619ca6d3bd32c052b7582d2af5c13dd7fc3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Thu, 16 Jul 2020 12:17:55 +0200 Subject: [PATCH 04/26] Correcting borders of scrollbar. --- generic/gtkTtk_Scrollbar.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/gtkTtk_Scrollbar.cpp b/generic/gtkTtk_Scrollbar.cpp index 18298fe..3b0bea4 100644 --- a/generic/gtkTtk_Scrollbar.cpp +++ b/generic/gtkTtk_Scrollbar.cpp @@ -44,12 +44,12 @@ static void ScrollbarTroughElementGeometry( GTKTTK_ENSURE_GTK_STYLE_ENGINE_ACTIVE; GTKTTK_ENSURE_WIDGET_OK; GtkTtk_gtk_widget_style_get(widget, "trough-border", &trough_border, NULL); - // xt = widget->style->xthickness; - // yt = widget->style->ythickness; - *paddingPtr = Ttk_MakePadding(xt + trough_border, - yt + trough_border, - xt + trough_border, - yt + trough_border); + xt = widget->style->xthickness; + yt = widget->style->ythickness; + *paddingPtr = Ttk_MakePadding(xt + trough_border - xt, + yt + trough_border - yt, + xt + trough_border + xt, + yt + trough_border + yt); } static void ScrollbarTroughElementDraw( @@ -198,10 +198,10 @@ static void ScrollbarUpArrowElementGeometry( } xt = widget->style->xthickness; yt = widget->style->ythickness; - *paddingPtr = Ttk_MakePadding(xt + trough_border, - yt + trough_border, - xt + trough_border, - yt + trough_border); + *paddingPtr = Ttk_MakePadding(trough_border - xt, + trough_border - yt, + trough_border + xt, + trough_border + yt); } static void ScrollbarUpArrowElementDraw( From 18a48c5023a59da6853cc2d626fe0713f8297798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Thu, 16 Jul 2020 12:29:29 +0200 Subject: [PATCH 05/26] Upgrade version to 0.7 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 225e84d..b9c315d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT ( gtkTtk ) ## Package version information. SET ( PKG_NAME ${PROJECT_NAME} ) SET ( PKG_MAJOR_VERSION 0 ) -SET ( PKG_MINOR_VERSION 6 ) +SET ( PKG_MINOR_VERSION 7 ) SET ( PKG_BUILD_VERSION 0 ) SET ( PKG_VERSION "${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" ) From 830f65a4e2461c4adc33647f8020f60dde8fbd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Thu, 4 Aug 2022 13:02:49 +0200 Subject: [PATCH 06/26] Draw default background to avoid transparency problems. --- generic/gtkTtk_Scrollbar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/gtkTtk_Scrollbar.cpp b/generic/gtkTtk_Scrollbar.cpp index 3b0bea4..6aa583b 100644 --- a/generic/gtkTtk_Scrollbar.cpp +++ b/generic/gtkTtk_Scrollbar.cpp @@ -147,7 +147,7 @@ static void ScrollbarThumbElementDraw( GTKTTK_WIDGET_SET_FOCUS(widget); adj = GtkTtk_gtk_range_get_adjustment((GtkRange *) widget); GtkTtk_gtk_adjustment_set_value(adj,GtkTtk_ValueFromSlider(wc, tkwin, b)); - // GTKTTK_DEFAULT_BACKGROUND; + GTKTTK_DEFAULT_BACKGROUND; GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, widget, "trough", 0, 0, b.width, b.height); @@ -224,7 +224,7 @@ static void ScrollbarUpArrowElementDraw( GTKTTK_SECTION_STEPPERS|GTKTTK_SECTION_ALL); // GTKTTK_SETUP_WIDGET_SIZE(b.width, b.height); GTKTTK_WIDGET_SET_FOCUS(widget); - // GTKTTK_DEFAULT_BACKGROUND; + GTKTTK_DEFAULT_BACKGROUND; // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, widget, horizontal ? "hscrollbar":"vscrollbar", @@ -289,7 +289,7 @@ static void ScrollbarDownArrowElementDraw( GTKTTK_SECTION_STEPPERS|GTKTTK_SECTION_ALL); // GTKTTK_SETUP_WIDGET_SIZE(b.width, b.height); GTKTTK_WIDGET_SET_FOCUS(widget); - // GTKTTK_DEFAULT_BACKGROUND; + GTKTTK_DEFAULT_BACKGROUND; // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, widget, horizontal ? "hscrollbar":"vscrollbar", From 3b633f3a34f28c5d027452a11d91a2c6382b12dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 16 Aug 2022 15:32:37 +0200 Subject: [PATCH 07/26] Correcting the geometry of scrollbar. --- generic/gtkTtk_Scrollbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/gtkTtk_Scrollbar.cpp b/generic/gtkTtk_Scrollbar.cpp index 6aa583b..8707885 100644 --- a/generic/gtkTtk_Scrollbar.cpp +++ b/generic/gtkTtk_Scrollbar.cpp @@ -46,10 +46,10 @@ static void ScrollbarTroughElementGeometry( GtkTtk_gtk_widget_style_get(widget, "trough-border", &trough_border, NULL); xt = widget->style->xthickness; yt = widget->style->ythickness; - *paddingPtr = Ttk_MakePadding(xt + trough_border - xt, - yt + trough_border - yt, - xt + trough_border + xt, - yt + trough_border + yt); + *paddingPtr = Ttk_MakePadding(xt + trough_border, + yt + trough_border, + xt + trough_border, + yt + trough_border); } static void ScrollbarTroughElementDraw( From cc75d839af54bb8c4e5f15c441b6ce33c49c9c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 16 Aug 2022 15:35:52 +0200 Subject: [PATCH 08/26] The radio button now draw entirely, tested a lot with Adwaita and Breeze themes. --- generic/gtkTtk_RadioButton.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index 887817d..a63633e 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -40,9 +40,9 @@ static void RadioButtonIndicatorElementGeometry( "indicator-spacing", &spacing, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); - *widthPtr = *heightPtr = size+spacing; - size = focus_pad + focus_width; - *paddingPtr = Ttk_MakePadding(spacing+size, size, spacing+size, size); + *widthPtr = *heightPtr = size+spacing*2+focus_width+focus_pad; + size = focus_width; + *paddingPtr = Ttk_MakePadding(*widthPtr, size, *widthPtr, size); } static void RadioButtonIndicatorElementDraw( @@ -51,12 +51,15 @@ static void RadioButtonIndicatorElementDraw( { GTKTTK_GTK_DRAWABLE_DEFINITIONS; gint indicator_size, x, y; + const gint MAGIC_HEIGHT_WIDTH_COMPLEMENT = 40; GTKTTK_ENSURE_GTK_STYLE_ENGINE_ACTIVE; GtkWidget *widget = GtkTtk_GetRadioButton(wc); GTKTTK_ENSURE_WIDGET_OK; - GTKTTK_DRAWABLE_FROM_WIDGET_SIZE(b.width+20, b.height+20); + GTKTTK_DRAWABLE_FROM_WIDGET_SIZE(b.width+MAGIC_HEIGHT_WIDTH_COMPLEMENT, + b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); GTKTTK_STYLE_BACKGROUND_DEFAULT; - GTKTTK_DEFAULT_BACKGROUND_SIZE(b.width+20, b.height+20); + GTKTTK_DEFAULT_BACKGROUND_SIZE(b.width+MAGIC_HEIGHT_WIDTH_COMPLEMENT + , b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); GTKTTK_STYLE_FROM_WIDGET; GTKTTK_WIDGET_SET_FOCUS(widget); GtkTtk_gtk_widget_style_get(widget, @@ -65,15 +68,15 @@ static void RadioButtonIndicatorElementDraw( GTKTTK_SECTION_BUTTONS|GTKTTK_SECTION_ALL); if (state & TTK_STATE_FOCUS) { GtkTtk_gtk_paint_focus(style, gdkDrawable, gtkState, NULL, widget, - "radiobutton", 0, 0, b.width + 20, b.height + 20); + "radiobutton", 0, 0, b.width + indicator_size, b.height + indicator_size); } - // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); - x = 10 + (b.width - indicator_size) / 2; - y = 10 + (b.height - indicator_size) / 2; + GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); + x = b.width - indicator_size; + y = b.height - indicator_size / 2 -1; GtkTtk_gtk_paint_option(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, "radiobutton", x, y, indicator_size, indicator_size); GtkTtk_CopyGtkPixmapOnToDrawable(gdkDrawable, d, tkwin, - 10, 10, b.width, b.height, b.x, b.y); + 10, 10, b.width + indicator_size, b.height + indicator_size, b.x, b.y); GTKTTK_CLEANUP_GTK_DRAWABLE; } From c24e6262f234e333a600fcfc4c539f46f8bafdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Fri, 19 Aug 2022 04:04:31 +0200 Subject: [PATCH 09/26] Now the Checkbutton is drawn perfectly with Breeze and Breeze dark. --- generic/gtkTtk_CheckButton.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/generic/gtkTtk_CheckButton.cpp b/generic/gtkTtk_CheckButton.cpp index 2f4a256..bf67d2e 100644 --- a/generic/gtkTtk_CheckButton.cpp +++ b/generic/gtkTtk_CheckButton.cpp @@ -40,9 +40,14 @@ static void CheckButtonIndicatorElementGeometry( "indicator-spacing", &spacing, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); - *widthPtr = *heightPtr = size+spacing; - size = focus_pad + focus_width; - *paddingPtr = Ttk_MakePadding(spacing+size, size, spacing+size, size); + *widthPtr = *heightPtr = spacing*2+size+focus_width+focus_pad; + size = focus_width; + *paddingPtr = Ttk_MakePadding(*widthPtr, + size, + *widthPtr, + size); + printf("spacing=%d, size=%d, focus_width=%d, focus_pad=%d\n", + spacing, size, focus_width, focus_pad); } static void CheckButtonIndicatorElementDraw( From 4eec46c548b06719e15bc3f1cd90a407dd61e556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Fri, 19 Aug 2022 04:09:02 +0200 Subject: [PATCH 10/26] Remove debug printings. --- generic/gtkTtk_CheckButton.cpp | 2 -- generic/gtkTtk_RadioButton.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/generic/gtkTtk_CheckButton.cpp b/generic/gtkTtk_CheckButton.cpp index bf67d2e..02faaa2 100644 --- a/generic/gtkTtk_CheckButton.cpp +++ b/generic/gtkTtk_CheckButton.cpp @@ -46,8 +46,6 @@ static void CheckButtonIndicatorElementGeometry( size, *widthPtr, size); - printf("spacing=%d, size=%d, focus_width=%d, focus_pad=%d\n", - spacing, size, focus_width, focus_pad); } static void CheckButtonIndicatorElementDraw( diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index a63633e..e9cb350 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -70,7 +70,7 @@ static void RadioButtonIndicatorElementDraw( GtkTtk_gtk_paint_focus(style, gdkDrawable, gtkState, NULL, widget, "radiobutton", 0, 0, b.width + indicator_size, b.height + indicator_size); } - GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); + // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); x = b.width - indicator_size; y = b.height - indicator_size / 2 -1; GtkTtk_gtk_paint_option(style, gdkDrawable, gtkState, gtkShadow, NULL, From 9537af5607eaa2c3dc92faf868a7c7615237167f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 23 Aug 2022 14:27:17 +0200 Subject: [PATCH 11/26] Height and width must be different for a good looking and placing. --- generic/gtkTtk_RadioButton.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index e9cb350..05f552c 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -40,7 +40,8 @@ static void RadioButtonIndicatorElementGeometry( "indicator-spacing", &spacing, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); - *widthPtr = *heightPtr = size+spacing*2+focus_width+focus_pad; + *widthPtr = size+focus_width+focus_pad; + *heightPtr = size+spacing*2+focus_width+focus_pad; size = focus_width; *paddingPtr = Ttk_MakePadding(*widthPtr, size, *widthPtr, size); } From dc34206ed45d0820f6d8d63a3bf898de92dab631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 23 Aug 2022 14:27:40 +0200 Subject: [PATCH 12/26] Make the entry widget looking good. --- generic/gtkTtk_Utilities.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/gtkTtk_Utilities.cpp b/generic/gtkTtk_Utilities.cpp index 6e47ba1..2e1a6f8 100644 --- a/generic/gtkTtk_Utilities.cpp +++ b/generic/gtkTtk_Utilities.cpp @@ -451,7 +451,7 @@ unsigned int GtkTtk_StateShadowTableLookup(GtkTtk_StateTable *map, } map = NULL; /* Do not search the table */ } else if (section & GTKTTK_SECTION_BUTTONS || - section & GTKTTK_SECTION_ENTRY || + section & GTKTTK_SECTION_ENTRY || section & GTKTTK_SECTION_SCROLLBAR) { /* Whether the button is drawn pressed or not, is defined by shadow. */ if (state & TTK_STATE_PRESSED || state & TTK_STATE_SELECTED) { @@ -464,7 +464,8 @@ unsigned int GtkTtk_StateShadowTableLookup(GtkTtk_StateTable *map, // else if (state & TTK_STATE_FOCUS) gtkState = GTK_STATE_ACTIVE; } if (section & GTKTTK_SECTION_ENTRY) { - if (state & TTK_STATE_FOCUS) gtkState = GTK_STATE_ACTIVE; + if (state & TTK_STATE_FOCUS) gtkState = GTK_STATE_NORMAL; + gtkShadow = GTK_SHADOW_IN; } if ((state & TTK_STATE_ACTIVE) && (!(state & TTK_STATE_PRESSED) && !(state & TTK_STATE_SELECTED))) { From e34864a06d990a306f4835566a3e781f2caec915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 23 Aug 2022 17:44:10 +0200 Subject: [PATCH 13/26] Make height in padding. Remove the magic 10. --- generic/gtkTtk_RadioButton.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index 05f552c..1781627 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -41,9 +41,9 @@ static void RadioButtonIndicatorElementGeometry( "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); *widthPtr = size+focus_width+focus_pad; - *heightPtr = size+spacing*2+focus_width+focus_pad; + *heightPtr = size+spacing*2+focus_pad; size = focus_width; - *paddingPtr = Ttk_MakePadding(*widthPtr, size, *widthPtr, size); + *paddingPtr = Ttk_MakePadding(*heightPtr, size, *widthPtr, size); } static void RadioButtonIndicatorElementDraw( @@ -51,7 +51,7 @@ static void RadioButtonIndicatorElementDraw( Drawable d, Ttk_Box b, unsigned state) { GTKTTK_GTK_DRAWABLE_DEFINITIONS; - gint indicator_size, x, y; + gint indicator_size, x, y, focus_pad; const gint MAGIC_HEIGHT_WIDTH_COMPLEMENT = 40; GTKTTK_ENSURE_GTK_STYLE_ENGINE_ACTIVE; GtkWidget *widget = GtkTtk_GetRadioButton(wc); @@ -64,7 +64,8 @@ static void RadioButtonIndicatorElementDraw( GTKTTK_STYLE_FROM_WIDGET; GTKTTK_WIDGET_SET_FOCUS(widget); GtkTtk_gtk_widget_style_get(widget, - "indicator-size", &indicator_size, NULL); + "indicator-size", &indicator_size, + "focus-padding", &focus_pad, NULL); GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_BUTTONS|GTKTTK_SECTION_ALL); if (state & TTK_STATE_FOCUS) { @@ -72,12 +73,12 @@ static void RadioButtonIndicatorElementDraw( "radiobutton", 0, 0, b.width + indicator_size, b.height + indicator_size); } // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); - x = b.width - indicator_size; - y = b.height - indicator_size / 2 -1; + x = b.width - indicator_size / 2; + y = b.height - indicator_size / 2 -focus_pad; GtkTtk_gtk_paint_option(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, "radiobutton", x, y, indicator_size, indicator_size); GtkTtk_CopyGtkPixmapOnToDrawable(gdkDrawable, d, tkwin, - 10, 10, b.width + indicator_size, b.height + indicator_size, b.x, b.y); + b.width/2, b.height/2, b.width + indicator_size, b.height + indicator_size, b.x, b.y); GTKTTK_CLEANUP_GTK_DRAWABLE; } From e7daccb2f7088a6cccebeff6bfcf5b213f29042f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Wed, 24 Aug 2022 12:14:50 +0200 Subject: [PATCH 14/26] Switch to 0.8 version. --- CMakeLists.txt | 2 +- library/pkgIndex.tcl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9c315d..242bfda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT ( gtkTtk ) ## Package version information. SET ( PKG_NAME ${PROJECT_NAME} ) SET ( PKG_MAJOR_VERSION 0 ) -SET ( PKG_MINOR_VERSION 7 ) +SET ( PKG_MINOR_VERSION 8 ) SET ( PKG_BUILD_VERSION 0 ) SET ( PKG_VERSION "${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" ) diff --git a/library/pkgIndex.tcl b/library/pkgIndex.tcl index 32ba9a0..8470784 100644 --- a/library/pkgIndex.tcl +++ b/library/pkgIndex.tcl @@ -1,2 +1,2 @@ -package ifneeded ttk::theme::gtkTtk 0.6 \ - [list load [file join $dir libgtkTtk0.6[info sharedlibextension]] gtkTtk] \ No newline at end of file +package ifneeded ttk::theme::gtkTtk 0.8 \ + [list load [file join $dir libgtkTtk0.8[info sharedlibextension]] gtkTtk] \ No newline at end of file From ecbf506eaac8fd6d4e00ec87d51c8e6a89419e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Wed, 24 Aug 2022 12:18:32 +0200 Subject: [PATCH 15/26] tile->ttk on demos --- demos/StyleIntrospection.tcl | 8 +++----- demos/autocomplete.tcl | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/demos/StyleIntrospection.tcl b/demos/StyleIntrospection.tcl index ca78a88..4613bb1 100644 --- a/demos/StyleIntrospection.tcl +++ b/demos/StyleIntrospection.tcl @@ -3,10 +3,8 @@ ## This demo shows information about the Gtk/GNOME style currently in use. ## ############################################################################### -if {[catch {package require Ttk}]} { - package require tile -} -ttk::setTheme tilegtk +package require Tk +ttk::setTheme gtkTtk set win {} label $win.lbl_option -text Option: @@ -23,7 +21,7 @@ foreach base {fg bg base text light mid dark text_aa} { label $win.$base -text "$base:" -anchor w grid $win.$base -row $row -column $col foreach state {NORMAL PRELIGHT ACTIVE SELECTED INSENSITIVE} { - set colour [ttk::theme::tilegtk::currentThemeColour ${base}($state)] + set colour [ttk::theme::gtkTtk::currentThemeColour ${base}($state)] label $win.${base}_$state -background $colour \ -relief raised -borderwidth 1 label $win.${base}_${state}_value -text $colour diff --git a/demos/autocomplete.tcl b/demos/autocomplete.tcl index c4bf8b7..c8a7e51 100644 --- a/demos/autocomplete.tcl +++ b/demos/autocomplete.tcl @@ -1,7 +1,7 @@ # # $Id: autocomplete.tcl,v 1.1 2008/08/03 14:52:09 petasis Exp $ # -# Demonstration of inline auto-completion for Tile combobox widgets. +# Demonstration of inline auto-completion for Ttk combobox widgets. # # Usage: # @@ -16,7 +16,7 @@ # overhead. # -namespace eval tile::combobox { +namespace eval ttk::combobox { namespace export enableAutocomplete } @@ -24,7 +24,7 @@ namespace eval tile::combobox { # # Enable inline auto-completion for the specified combobox widget. # -proc tile::combobox::enableAutocomplete { w {presorted 1} } { +proc ttk::combobox::enableAutocomplete { w {presorted 1} } { bind $w [namespace code [list DoAutoComplete %W %A $presorted]] } @@ -32,9 +32,9 @@ proc tile::combobox::enableAutocomplete { w {presorted 1} } { # # Perform inline auto-completion of typed text in the combobox. # -proc tile::combobox::DoAutoComplete { w s presorted } { +proc ttk::combobox::DoAutoComplete { w s presorted } { set old [$w get] - tile::entry::Insert $w $s + ttk::entry::Insert $w $s set new [$w get] # Only auto-complete if the string length has changed due to insertion. From fc106b9f4c6dbf95f76227837ae22b2824e666ec Mon Sep 17 00:00:00 2001 From: rdbende Date: Thu, 22 Dec 2022 22:36:20 +0100 Subject: [PATCH 16/26] Removing filled color from Scale --- generic/gtkTtk_Scale.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/generic/gtkTtk_Scale.cpp b/generic/gtkTtk_Scale.cpp index 2562224..d4ddef4 100644 --- a/generic/gtkTtk_Scale.cpp +++ b/generic/gtkTtk_Scale.cpp @@ -39,13 +39,12 @@ static void ScaleTroughElementGeometry( { GTKTTK_WIDGET_CACHE_DEFINITION; gint trough_border = 0; - int xt = 0, yt = 0; GtkWidget *widget = GtkTtk_GetScale(wc); GTKTTK_ENSURE_GTK_STYLE_ENGINE_ACTIVE; GTKTTK_ENSURE_WIDGET_OK; GtkTtk_gtk_widget_style_get(widget, "trough-border", &trough_border, NULL); - // xt = widget->style->xthickness; - // yt = widget->style->ythickness; + int xt = widget->style->xthickness; + int yt = widget->style->ythickness; *paddingPtr = Ttk_MakePadding(xt + trough_border, yt + trough_border, xt + trough_border, @@ -72,21 +71,8 @@ static void ScaleTroughElementDraw( &trough_side_details, NULL); // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); if (trough_side_details) { - int trough_change_pos_x = b.width, trough_change_pos_y = b.height; - if (wc->gtkOrientation == GTK_ORIENTATION_HORIZONTAL) - trough_change_pos_x = b.width / 2; - else - trough_change_pos_y = b.height / 2; GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, - widget, "trough-upper", 0, 0, - trough_change_pos_x, trough_change_pos_y); - if (wc->gtkOrientation == GTK_ORIENTATION_HORIZONTAL) - trough_change_pos_y = 0; - else - trough_change_pos_x = 0; - GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, - widget, "trough-lower", trough_change_pos_x, trough_change_pos_y, - b.width-trough_change_pos_x, b.height-trough_change_pos_y); + widget, "trough-upper", 0, 0, b.width, b.height); } else { GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, widget, "trough", 0, 0, b.width, b.height); From 75a535cff47c033ef98b680d5ae0fd727c7e1ce9 Mon Sep 17 00:00:00 2001 From: rdbende Date: Thu, 22 Dec 2022 23:06:21 +0100 Subject: [PATCH 17/26] Fix radiobutton focused state --- generic/gtkTtk_RadioButton.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index 1781627..b0ca7c2 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -57,28 +57,23 @@ static void RadioButtonIndicatorElementDraw( GtkWidget *widget = GtkTtk_GetRadioButton(wc); GTKTTK_ENSURE_WIDGET_OK; GTKTTK_DRAWABLE_FROM_WIDGET_SIZE(b.width+MAGIC_HEIGHT_WIDTH_COMPLEMENT, - b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); + b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); GTKTTK_STYLE_BACKGROUND_DEFAULT; - GTKTTK_DEFAULT_BACKGROUND_SIZE(b.width+MAGIC_HEIGHT_WIDTH_COMPLEMENT - , b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); + GTKTTK_DEFAULT_BACKGROUND_SIZE(b.width+MAGIC_HEIGHT_WIDTH_COMPLEMENT, + b.height+MAGIC_HEIGHT_WIDTH_COMPLEMENT); GTKTTK_STYLE_FROM_WIDGET; GTKTTK_WIDGET_SET_FOCUS(widget); GtkTtk_gtk_widget_style_get(widget, - "indicator-size", &indicator_size, - "focus-padding", &focus_pad, NULL); + "indicator-size", &indicator_size, NULL); GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_BUTTONS|GTKTTK_SECTION_ALL); - if (state & TTK_STATE_FOCUS) { - GtkTtk_gtk_paint_focus(style, gdkDrawable, gtkState, NULL, widget, - "radiobutton", 0, 0, b.width + indicator_size, b.height + indicator_size); - } // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); - x = b.width - indicator_size / 2; - y = b.height - indicator_size / 2 -focus_pad; + x = (b.width - indicator_size) / 2; + y = (b.height - indicator_size) / 2; GtkTtk_gtk_paint_option(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, "radiobutton", x, y, indicator_size, indicator_size); GtkTtk_CopyGtkPixmapOnToDrawable(gdkDrawable, d, tkwin, - b.width/2, b.height/2, b.width + indicator_size, b.height + indicator_size, b.x, b.y); + 0, 0, b.width, b.height, b.x, b.y); GTKTTK_CLEANUP_GTK_DRAWABLE; } From 003245c25c135feae7a6b91c0ad782074e82a536 Mon Sep 17 00:00:00 2001 From: rdbende Date: Thu, 22 Dec 2022 23:18:36 +0100 Subject: [PATCH 18/26] Remove unused variable declaration --- generic/gtkTtk_RadioButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/gtkTtk_RadioButton.cpp b/generic/gtkTtk_RadioButton.cpp index b0ca7c2..da3467e 100644 --- a/generic/gtkTtk_RadioButton.cpp +++ b/generic/gtkTtk_RadioButton.cpp @@ -51,7 +51,7 @@ static void RadioButtonIndicatorElementDraw( Drawable d, Ttk_Box b, unsigned state) { GTKTTK_GTK_DRAWABLE_DEFINITIONS; - gint indicator_size, x, y, focus_pad; + gint indicator_size, x, y; const gint MAGIC_HEIGHT_WIDTH_COMPLEMENT = 40; GTKTTK_ENSURE_GTK_STYLE_ENGINE_ACTIVE; GtkWidget *widget = GtkTtk_GetRadioButton(wc); From 97fb189ebb0eac4994311c4b810533b800da55bb Mon Sep 17 00:00:00 2001 From: rdbende Date: Thu, 22 Dec 2022 23:53:20 +0100 Subject: [PATCH 19/26] Fix glitch on progressbar background --- generic/gtkTtk_Progress.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/gtkTtk_Progress.cpp b/generic/gtkTtk_Progress.cpp index 9067026..ab22af8 100644 --- a/generic/gtkTtk_Progress.cpp +++ b/generic/gtkTtk_Progress.cpp @@ -55,7 +55,7 @@ static void ProgressTroughElementDraw( GTKTTK_SECTION_TROUGH|GTKTTK_SECTION_ALL); // GTKTTK_SETUP_WIDGET_SIZE(b.width, b.height); GTKTTK_WIDGET_SET_FOCUS(widget); - // GTKTTK_DEFAULT_BACKGROUND; + GTKTTK_DEFAULT_BACKGROUND; // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_gtk_paint_box(style, gdkDrawable, gtkState, GTK_SHADOW_IN, NULL, widget, "trough", 0, 0, b.width, b.height); @@ -118,6 +118,7 @@ static void ProgressBarElementDraw( GTKTTK_ENSURE_WIDGET_OK; GTKTTK_STYLE_FROM_WIDGET; GTKTTK_DRAWABLE_FROM_WIDGET; + GTKTTK_DEFAULT_BACKGROUND; // Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value); // Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum); // if (strncmp(Tcl_GetString(pbar->modeObj), "determinate", 10) != 0) { From 776299e055697e16e85e5daea98e66a00360a55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 01:55:02 +0200 Subject: [PATCH 20/26] Adding the Treeview style configuration. --- library/gtkTtk.tcl | 84 ++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/library/gtkTtk.tcl b/library/gtkTtk.tcl index d9c6cb6..2399dd6 100644 --- a/library/gtkTtk.tcl +++ b/library/gtkTtk.tcl @@ -238,21 +238,39 @@ namespace eval ttk::theme::gtkTtk { -foreground [currentThemeColour fg(NORMAL)] \ -selectforeground [currentThemeColour fg(SELECTED)] \ -selectbackground [currentThemeColour bg(SELECTED)] \ - ; - # ttk::style map . -foreground [list \ - # active [currentThemeColour fg(ACTIVE)] \ - # disabled [currentThemeColour fg(INSENSITIVE)] \ - # focus [currentThemeColour fg(PRELIGHT)] \ - # pressed [currentThemeColour fg(ACTIVE)] \ - # selected [currentThemeColour fg(SELECTED)] \ - # ] -background [list \ - # active [currentThemeColour bg(ACTIVE)] \ - # disabled [currentThemeColour bg(INSENSITIVE)] \ - # pressed [currentThemeColour bg(PRELIGHT)] \ - # pressed [currentThemeColour bg(ACTIVE)] \ - # selected [currentThemeColour bg(SELECTED)] \ - # ] - + ; + + # Configuration of the ttk::Treeview + ttk::style map Treeview -foreground [list \ + active [currentThemeColour fg(ACTIVE)] \ + disabled [currentThemeColour fg(INSENSITIVE)] \ + focus [currentThemeColour fg(PRELIGHT)] \ + pressed [currentThemeColour fg(ACTIVE)] \ + selected [currentThemeColour fg(SELECTED)] \ + ] -background [list \ + active [currentThemeColour bg(ACTIVE)] \ + disabled [currentThemeColour bg(INSENSITIVE)] \ + pressed [currentThemeColour bg(ACTIVE)] \ + selected [currentThemeColour bg(SELECTED)] \ + ] + + ttk::style map Treeview.Heading -foreground [list \ + active [currentThemeColour bg(ACTIVE)] \ + disabled [currentThemeColour bg(INSENSITIVE)] \ + focus [currentThemeColour bg(PRELIGHT)] \ + pressed [currentThemeColour bg(PRELIGHT)] \ + selected [currentThemeColour bg(SELECTED)] \ + ] -background [list \ + active [currentThemeColour fg(ACTIVE)] \ + disabled [currentThemeColour fg(INSENSITIVE)] \ + focus [currentThemeColour bg(PRELIGHT)] \ + pressed [currentThemeColour fg(PRELIGHT)] \ + selected [currentThemeColour fg(SELECTED)] \ + ] + ttk::style configure Treeview.Heading -relief ridge \ + -background [currentThemeColour bg(ACTIVE)] + ttk::style configure Treeview.Item -indicatormargins {1 2 1 1} -indicatorsize 5 + # ttk::style map TButton -foreground [list \ # ] -background [list \ # ] @@ -347,38 +365,8 @@ namespace eval ttk::theme::gtkTtk { # PM_DefaultFrameWidth} { # puts "$pm: [getPixelMetric -$pm]" # } - };# updateStyles - - proc kdeLocate_kdeglobals {} { - return - set KDE_dirs {} - # As a first step, examine the KDE env variables... - global env - foreach {var cmd} {KDEHOME {kde-config --localprefix} - KDEDIRS {} - KDEDIR {kde-config --prefix}} { - if {[info exists env($var)]} { - set paths [set env($var)] - if {[string length $paths]} { - foreach path [split $paths :] {lappend KDE_dirs $path} - } - } - if {[string length $cmd]} { - if {![catch {eval exec $cmd} dir]} { - lappend KDE_dirs $dir - } - } - } - # Now, examine all the paths found to locate the kdeglobals file. - set PATHS {} - foreach path $KDE_dirs { - if {[file exists $path/share/config/kdeglobals]} { - lappend PATHS $path/share/config/kdeglobals - } - } - return $PATHS - };# kdeLocate_kdeglobals - +};# updateStyles + ## updateColourPalette: # This procedure will be called from gtkTtk core each time a message is # received from KDE to change the palette used. @@ -695,7 +683,7 @@ namespace eval ttk::theme::gtkTtk { if {0 && ![info exists ::testConfigurationPanel]} { toplevel .themeConfPanel wm withdraw .themeConfPanel - wm title .themeConfPanel "TileGTK Configuration Panel..." + wm title .themeConfPanel "GtkTtk Configuration Panel..." frame .themeConfPanel.page createThemeConfigurationPanel .themeConfPanel.page update From 69813d6737d514863ece1b86091376bba792cc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 02:03:30 +0200 Subject: [PATCH 21/26] Better populate the Treeview for testing. --- demos/demo.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demos/demo.tcl b/demos/demo.tcl index f1ae8ce..498b174 100644 --- a/demos/demo.tcl +++ b/demos/demo.tcl @@ -529,6 +529,10 @@ proc tree.pane {w} { $w.t heading Class -text "Class" bind $w.t <> [list fillTree $w.t] + lmap child {un deux trois quatre} { + $w.t insert {} end -text $child + } + return $w } @@ -544,7 +548,7 @@ proc fillTree {tv} { # # Replace tree item children with current list of child windows. # - $tv delete [$tv children $id] +# $tv delete [$tv children $id] set children [winfo children $id] foreach child $children { $tv insert $id end -id $child -text [winfo name $child] -open 0 \ From 9afa71e0e3a156518c5c34c79b4c91c10a5da7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 02:03:43 +0200 Subject: [PATCH 22/26] Addding the commented stateinfo --- generic/gtkTtk_Combobox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/gtkTtk_Combobox.cpp b/generic/gtkTtk_Combobox.cpp index 4f54ffd..61e4cbe 100644 --- a/generic/gtkTtk_Combobox.cpp +++ b/generic/gtkTtk_Combobox.cpp @@ -70,6 +70,7 @@ static void ComboboxFieldElementDraw( GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_ENTRY|GTKTTK_SECTION_ALL); GTKTTK_WIDGET_SET_FOCUS(widget); + // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_gtk_paint_shadow(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, "combobox", 0, 0, b.width, b.height); } @@ -127,6 +128,7 @@ static void ComboboxArrowElementDraw( GTKTTK_ENSURE_WIDGET_OK; GTKTTK_STYLE_FROM_WIDGET; GTKTTK_DRAWABLE_FROM_WIDGET; + // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_BUTTONS|GTKTTK_SECTION_ALL); GTKTTK_WIDGET_SET_FOCUS(widget); @@ -140,6 +142,7 @@ static void ComboboxArrowElementDraw( GtkTtk_StateShadowTableLookup(NULL, state, gtkState, gtkShadow, GTKTTK_SECTION_ENTRY|GTKTTK_SECTION_ALL); GTKTTK_WIDGET_SET_FOCUS(widget); + // GtkTtk_StateInfo(state, gtkState, gtkShadow, tkwin, widget); GtkTtk_gtk_paint_flat_box(style, gdkDrawable, gtkState, gtkShadow, NULL, widget, "combobox", 0, 0, b.width, b.height); } From 89884af4c3558c0d64a2a867d47d04c4c83f96fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 02:46:17 +0200 Subject: [PATCH 23/26] Set the fieldbackground color of the Treeview --- library/gtkTtk.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/library/gtkTtk.tcl b/library/gtkTtk.tcl index 2399dd6..8e99f51 100644 --- a/library/gtkTtk.tcl +++ b/library/gtkTtk.tcl @@ -270,6 +270,7 @@ namespace eval ttk::theme::gtkTtk { ttk::style configure Treeview.Heading -relief ridge \ -background [currentThemeColour bg(ACTIVE)] ttk::style configure Treeview.Item -indicatormargins {1 2 1 1} -indicatorsize 5 + ttk::style configure Treeview -fieldbackground [currentThemeColour bg(INSENSITIVE)] # ttk::style map TButton -foreground [list \ # ] -background [list \ From ab7076f276600e5c288ff0bc24e612c4c61a2ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 02:46:35 +0200 Subject: [PATCH 24/26] Propogate grid on all frame. --- demos/demo.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/demo.tcl b/demos/demo.tcl index 498b174..b597c7a 100644 --- a/demos/demo.tcl +++ b/demos/demo.tcl @@ -517,7 +517,7 @@ proc tree.pane {w} { grid $w.t $w.vsb -sticky nwse grid columnconfigure $w 0 -weight 1 grid rowconfigure $w 0 -weight 1 - grid propagate $w 0 + grid propagate $w 1 # # Add initial tree node: From 02afbfedaceee69c9f06c12349f55e438ee7aebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 17:08:20 +0200 Subject: [PATCH 25/26] Remove useless Heading options. Adding setting Menu colors based on the GTK theme colors. A big thanks to the git gui source code for doing that first. --- library/gtkTtk.tcl | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/library/gtkTtk.tcl b/library/gtkTtk.tcl index 8e99f51..0fff1fd 100644 --- a/library/gtkTtk.tcl +++ b/library/gtkTtk.tcl @@ -255,23 +255,27 @@ namespace eval ttk::theme::gtkTtk { ] ttk::style map Treeview.Heading -foreground [list \ - active [currentThemeColour bg(ACTIVE)] \ - disabled [currentThemeColour bg(INSENSITIVE)] \ - focus [currentThemeColour bg(PRELIGHT)] \ pressed [currentThemeColour bg(PRELIGHT)] \ - selected [currentThemeColour bg(SELECTED)] \ ] -background [list \ - active [currentThemeColour fg(ACTIVE)] \ - disabled [currentThemeColour fg(INSENSITIVE)] \ - focus [currentThemeColour bg(PRELIGHT)] \ pressed [currentThemeColour fg(PRELIGHT)] \ - selected [currentThemeColour fg(SELECTED)] \ ] - ttk::style configure Treeview.Heading -relief ridge \ - -background [currentThemeColour bg(ACTIVE)] - ttk::style configure Treeview.Item -indicatormargins {1 2 1 1} -indicatorsize 5 - ttk::style configure Treeview -fieldbackground [currentThemeColour bg(INSENSITIVE)] - + ttk::style configure Treeview.Heading -relief raised \ + -background [currentThemeColour bg(ACTIVE)] + ttk::style configure Treeview.Item -indicatormargins {1 2 1 1} -indicatorsize 5 + ttk::style configure Treeview -fieldbackground [currentThemeColour bg(INSENSITIVE)] + + set base_bg [ttk::style lookup . -background] + set base_fg [ttk::style lookup . -foreground] + set text_fg [ttk::style lookup Treeview -foreground] + set select_bg [ttk::style lookup Default -selectbackground] + set select_fg [ttk::style lookup Default -selectforeground] + + option add *Menu.Background $base_bg + option add *Menu.Foreground $base_fg + option add *Menu.activeBackground $select_bg + option add *Menu.activeForeground $select_fg + option add *Menu.selectColor $text_fg + # ttk::style map TButton -foreground [list \ # ] -background [list \ # ] From 06173cb9b60d1cdb809fab07f836588d600774c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?g=C3=A9ballin?= Date: Tue, 9 May 2023 17:08:33 +0200 Subject: [PATCH 26/26] Upgrade to 0.9 version --- CMakeLists.txt | 2 +- library/pkgIndex.tcl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 242bfda..d849c6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT ( gtkTtk ) ## Package version information. SET ( PKG_NAME ${PROJECT_NAME} ) SET ( PKG_MAJOR_VERSION 0 ) -SET ( PKG_MINOR_VERSION 8 ) +SET ( PKG_MINOR_VERSION 9 ) SET ( PKG_BUILD_VERSION 0 ) SET ( PKG_VERSION "${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" ) diff --git a/library/pkgIndex.tcl b/library/pkgIndex.tcl index 8470784..759e587 100644 --- a/library/pkgIndex.tcl +++ b/library/pkgIndex.tcl @@ -1,2 +1,2 @@ -package ifneeded ttk::theme::gtkTtk 0.8 \ - [list load [file join $dir libgtkTtk0.8[info sharedlibextension]] gtkTtk] \ No newline at end of file +package ifneeded ttk::theme::gtkTtk 0.9 \ + [list load [file join $dir libgtkTtk0.9[info sharedlibextension]] gtkTtk] \ No newline at end of file