diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/mapwindow.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/client/mapwindow.cc b/src/client/mapwindow.cc index de49ad9..23620f8 100644 --- a/src/client/mapwindow.cc +++ b/src/client/mapwindow.cc @@ -89,6 +89,7 @@ MapWindow::MapWindow(ui::Widget *parent) : ui::Window(parent) // map buttons mapwindow_zonebutton = new ui::IconButton(mapwindow_pane_left, "bitmaps/icons/button_map", "Zone map"); mapwindow_galaxybutton = new ui::IconButton(mapwindow_pane_left, "bitmaps/icons/button_galaxy", "Galaxy map"); + mapwindow_galaxybutton->hide(); // ---- window title mapwindow_titlelabel = new ui::Label(this); @@ -121,6 +122,8 @@ void MapWindow::show() // show map widget mapwindow_mode = ShowZone; mapwindow_galaxymapwidget->hide(); + mapwindow_galaxybutton->show(); + mapwindow_zonebutton->hide(); mapwindow_mapwidget->show(); mapwindow_mapwidget->set_zone(core::localplayer()->zone()); mapwindow_maplabel->set_text(mapwindow_mapwidget->zone()->name()); @@ -177,10 +180,10 @@ void MapWindow::resize() float l = (mapwindow_mapwidget->width() - math::min(mapwindow_mapwidget->width(), mapwindow_mapwidget->height())) * 0.5f; mapwindow_zonebutton->set_size(icon_size, icon_size); - mapwindow_zonebutton->set_location(mapwindow_maplabel->left() + l, mapwindow_mapwidget->bottom() + margin_vertical); + mapwindow_zonebutton->set_location(mapwindow_maplabel->right() - l - icon_size, mapwindow_mapwidget->bottom() + margin_vertical); mapwindow_galaxybutton->set_size(icon_size, icon_size); - mapwindow_galaxybutton->set_location(mapwindow_maplabel->right() - l - icon_size, mapwindow_mapwidget->bottom() + margin_vertical); + mapwindow_galaxybutton->set_location(mapwindow_zonebutton->location()); } // resize right pane @@ -366,8 +369,10 @@ bool MapWindow::on_emit(ui::Widget *sender, const ui::Widget::Event event, void if (mapwindow_galaxymapwidget->zone()) { mapwindow_mode = ShowZone; mapwindow_galaxymapwidget->hide(); + mapwindow_galaxybutton->show(); + mapwindow_zonebutton->hide(); mapwindow_mapwidget->set_zone(mapwindow_galaxymapwidget->zone()); - mapwindow_mapwidget->show(); + mapwindow_mapwidget->show(); mapwindow_maplabel->set_text(mapwindow_mapwidget->zone()->name()); show_zone_info(mapwindow_mapwidget->zone()); } @@ -390,6 +395,8 @@ bool MapWindow::on_emit(ui::Widget *sender, const ui::Widget::Event event, void mapwindow_galaxymapwidget->hide(); mapwindow_maplabel->set_text(mapwindow_mapwidget->zone()->name()); } + mapwindow_galaxybutton->show(); + mapwindow_zonebutton->hide(); return true; } @@ -406,6 +413,8 @@ bool MapWindow::on_emit(ui::Widget *sender, const ui::Widget::Event event, void show_zone_info(mapwindow_galaxymapwidget->zone()); mapwindow_maplabel->set_text("Starsystems"); } + mapwindow_galaxybutton->hide(); + mapwindow_zonebutton->show(); return true; } } |