Commit 7803062
committed
gtk/tk: Ensure no flicker when hovering over images.
When the mouse is over an image, the status message is two lines long.
This causes the toolbar to increase size slightly. On Qt, this is
ignored by a sizing policy, but there is no such thing in other
toolkits. On GTK this steals space from the canvas, so it re-draws a
little bit smaller, until the mouse moves off the image. On Tk, the
space is added to the window, _unless_ the window is maximized, and then
it's stolen from the canvas as well.
As a simple workaround, we add an additional label with invisible text
(spaces) on two lines. This forces the toolbar to always be two lines
high and thus not flicker. If the message were 3 or more lines long,
then the same thing would happen, but we don't have any of those by
default. The advantage of using a label is that it saves us having to
measure text in some toolkit-specific way, and thus works regardless of
theme.1 parent 98474c8 commit 7803062
2 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
515 | 523 | | |
516 | 524 | | |
517 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
524 | 535 | | |
525 | 536 | | |
526 | 537 | | |
| |||
536 | 547 | | |
537 | 548 | | |
538 | 549 | | |
539 | | - | |
| 550 | + | |
| 551 | + | |
540 | 552 | | |
541 | 553 | | |
542 | 554 | | |
| |||
0 commit comments