diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-31 14:39:04 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-31 14:39:04 (GMT) |
commit | 25d454344e3782af50e4de2b30951409e349dc07 (patch) | |
tree | 6faf126294b1235b3307dcc394cab895489ceef6 /generic/ttk | |
parent | 1d84ebe142bb392f1d8c24f0bb90f6be02530c24 (diff) | |
download | tk-25d454344e3782af50e4de2b30951409e349dc07.zip tk-25d454344e3782af50e4de2b30951409e349dc07.tar.gz tk-25d454344e3782af50e4de2b30951409e349dc07.tar.bz2 |
minor improvements to flag handling
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkEntry.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index c85751e..5d0a435 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1177,13 +1177,13 @@ static void EntryDisplay(void *clientData, Drawable d) textarea = Ttk_ClientRegion(entryPtr->core.layout, "textarea"); showCursor = - (entryPtr->core.flags & CURSOR_ON) != 0 + (entryPtr->core.flags & CURSOR_ON) && EntryEditable(entryPtr) && entryPtr->entry.insertPos >= leftIndex && entryPtr->entry.insertPos <= rightIndex ; showSelection = - (entryPtr->core.state & TTK_STATE_DISABLED) == 0 + !(entryPtr->core.state & TTK_STATE_DISABLED) && selFirst > -1 && selLast > leftIndex && selFirst <= rightIndex diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 15ceaa8..de9d795 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -791,7 +791,7 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) int side = 0; unsigned sideFlags = flags & _TTK_MASK_PACK; - while ((sideFlags & TTK_PACK_LEFT) == 0) { + while (!(sideFlags & TTK_PACK_LEFT)) { ++side; sideFlags >>= 1; } @@ -800,9 +800,11 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) } } - /* In Ttk_ParseLayoutTemplate, default -sticky is "nsew", - * so always include this even if no sticky bits are set. + /* + * In Ttk_ParseLayoutTemplate, default -sticky is "nsew", so always + * include this even if no sticky bits are set. */ + APPENDSTR("-sticky"); APPENDOBJ(Ttk_NewStickyObj(flags & _TTK_MASK_STICK)); |