[wesnoth-commits] [wesnoth/wesnoth] 47ddf8: gui2: Delegate mouse cursor reset to modal dialogs

Iris Morelle noreply at github.com
Wed Nov 13 03:05:12 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 47ddf8877f5bb481b933b2a3dbc012d4c156d69a
      https://github.com/wesnoth/wesnoth/commit/47ddf8877f5bb481b933b2a3dbc012d4c156d69a
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2019-11-13 (Wed, 13 Nov 2019)

  Changed paths:
    M src/gui/dialogs/modal_dialog.cpp
    M src/gui/widgets/window.cpp
    M src/gui/widgets/window.hpp

  Log Message:
  -----------
  gui2: Delegate mouse cursor reset to modal dialogs

Currently it's the gui2::window class' responsibility, by inheriting
from cursor::setter (yes) and offering absolutely no way to control it.
Unfortunately, it turns out that this can cause issues with tooltips
resetting the cursor at unexpected times when they get
displayed/hidden while having widgets change the cursor depending on
whether they have the mouse focus or not.

Right now the only modeless dialog we have is the tooltip dialog, and
really there's no reason to say that modeless dialogs should have the
ability to reset the cursor without explicitly asking for it. As for
modal dialogs... I don't entirely agree that they should do it either,
but for tradition's sake, let's just keep the current behaviour with
them.

(In an ideal world the cursor business would be managed by the window
managaer IMO, but I'm not ready to argue my case.)


  Commit: d7f2595393e2744d87ee504557b92264fca29741
      https://github.com/wesnoth/wesnoth/commit/d7f2595393e2744d87ee504557b92264fca29741
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2019-11-13 (Wed, 13 Nov 2019)

  Changed paths:
    M changelog.md
    A images/cursors-bw/ibeam.png
    A images/cursors/ibeam.png
    M src/cursor.cpp
    M src/cursor.hpp
    M src/gui/widgets/text_box_base.cpp
    M src/gui/widgets/text_box_base.hpp

  Log Message:
  -----------
  gui2/text_box: Implement I-beam cursor

This cursor is active when the widget has the mouse focus. You know,
like textboxes are wont to do anywhere else. Took long enough, although
there was an interaction issue with tooltips fixed in the previous
commit.

I still need to figure out how to make this work with GUI1 textboxes
(e.g. in-game console).

The colour version of the cursor was kindly provided by LordBob, and the
B&W version is my own.


Compare: https://github.com/wesnoth/wesnoth/compare/14c91f6e9941...d7f2595393e2



More information about the Commits mailing list