They show up as checkable GButtons in GToolBar, and with (or without) check
marks in menus.
There are a bunch of places to make use of this. This patch only takes
advantage of it in the FileManager for the view type actions.
We throw away the backing store if the window rect changes size. Since the
resizing happens asynchronously at the mercy of the WindowServer, we might
end up in set_rect() again before gaining a new backing store. So there are
no guarantees that the back/front bitmaps exist here.
Someone was playing this game and suggested a number of improvements so here
we go trying to address them:
- Add "chording" support, where you can click a numbered square using both
mouse buttons simultaneously to sweep all non-flagged adjacent squares.
- Mis-flagged squares are now revealed as such on game over, with a special
"bad flag" icon.
- The game timer now shows tenths of seconds. It also doesn't start until
you click the first square.
- Add the three difficulty modes from the classic Windows version.
This way you can spam small write()s on a file without the kernel writing
to disk every single time. Flushes are included in the FS::sync() operation
and will get triggered regularly by syncd. :^)
Put the cursor on the left or right side of a glyph when clicking it based
on distance to middle of glyphs. This is such an obvious change that makes
a small but noticeable difference in feel. :^)
This is not very obvious and I need to come up with a better design, but for
now just make sure to call did_change() before calling set_cursor().
This is needed because set_cursor() will try to scroll the cursor into view,
and for right-aligned text, did_change() may change the content rect which
needs to be reflected by the time we call scroll_cursor_into_view().
We were forgetting to translate the painter by the frame_thickness().
With this fixed, we can also do proper vertical centering of lines for
single-line editors, and things suddenly look nicer than ever! :^)
When computing the visible content rect, constrain the result to the content
size. The content shouldn't feel responsible for painting anything outside.
When using a right-side text alignment, hook the resize event to make sure
that the content width is at least frame_inner_rect().width() wide.
This allows us to use content_width() as the anchor point for right aligned
text, rather than using the frame inner rect, which was clearly wrong in
the overflow case.