#277 ColourSelector Appears Off Screen

Latest Subversion
closed-fixed
nobody
Interface (116)
3
2007-02-18
2007-01-15
No

On the options screen, colour options near the bottom of the FO window can spawn a colour selector window that appears parly off the screen.

Discussion

  • guardian24

    guardian24 - 2007-02-17

    Logged In: YES
    user_id=1536944
    Originator: NO

    It is not a bug, it is a annoyance. :)
    The color selection window is movable, so it is not a big deal.

    From CUIControls.cpp:

    void ColorSelector::LClick(const GG::Pt& pt, Uint32 keys)
    {
    GG::ColorDlg dlg(pt.x, pt.y, .......

    ColorDlg's height is 300, so it could be checked against the screen's height.
    Maybe it could be replaced with something like this:

    SDL_VideoInfo* vidinfo=SDL_GetVideoInfo();
    if ((pt.y+300) > vidinfo->current_h) {
    GG::ColorDlg dlg(pt.x,current_h-300, ......
    } else {
    GG::ColorDlg dlg(pt.x,pt.y, .......
    }

     
  • guardian24

    guardian24 - 2007-02-17

    Logged In: YES
    user_id=1536944
    Originator: NO

    Sorry for the spam, but i forgot to add a 'const' before SDL_VideoInfo*. :(

     
  • Geoff Topping

    Geoff Topping - 2007-02-18
    • status: open --> closed-fixed
     
  • Geoff Topping

    Geoff Topping - 2007-02-18

    Logged In: YES
    user_id=913462
    Originator: YES

    Fixed in SVN.

    Basic idea suggested is OK, but I used std::min and GG's built-in GUI-info getters, in the manner of:

    int x = std::min(pt.x, GG::GUI::GetGUI()->AppWidth() - 315); // 315 is width of ColorDlg from GG::ColorDlg:::ColorDlg

    in void ColorSelector::LClick(const GG::Pt& pt, Uint32 keys)

    Note that if the FO window is smaller than 315 x 300 pixels, this could lead to the ColorDlg appearing partly off the upper left of the window, but this seems less likely to be a problem in practice.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks