Skip to content

Commit

Permalink
Now the ttk::entry is drawn just like expected ! With it's background…
Browse files Browse the repository at this point in the history
… of the right color !
  • Loading branch information
Geballin committed May 25, 2020
1 parent 476f991 commit 504fe8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions generic/gtkTtk_Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions generic/gtkTtk_Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 504fe8c

Please sign in to comment.