diff --git a/client/fc_client.cpp b/client/fc_client.cpp index 28e1f2c471..acb88745f1 100644 --- a/client/fc_client.cpp +++ b/client/fc_client.cpp @@ -423,28 +423,6 @@ void fc_client::read_settings() } else { qt_settings.unit_info_pos_fy = 0.88; } - if (s.contains(QStringLiteral("minimap_x"))) { - qt_settings.minimap_x = s.value(QStringLiteral("minimap_x")).toFloat(); - } else { - qt_settings.minimap_x = 0.84; - } - if (s.contains(QStringLiteral("minimap_y"))) { - qt_settings.minimap_y = s.value(QStringLiteral("minimap_y")).toFloat(); - } else { - qt_settings.minimap_y = 0.79; - } - if (s.contains(QStringLiteral("minimap_width"))) { - qt_settings.minimap_width = - s.value(QStringLiteral("minimap_width")).toFloat(); - } else { - qt_settings.minimap_width = 0.15; - } - if (s.contains(QStringLiteral("minimap_height"))) { - qt_settings.minimap_height = - s.value(QStringLiteral("minimap_height")).toFloat(); - } else { - qt_settings.minimap_height = 0.2; - } if (s.contains(QStringLiteral("battlelog_scale"))) { qt_settings.battlelog_scale = s.value(QStringLiteral("battlelog_scale")).toFloat(); @@ -520,12 +498,6 @@ void fc_client::read_settings() if (qt_settings.battlelog_scale > 5.0) { qt_settings.battlelog_y = 5.0; } - if (qt_settings.minimap_x < 0 || qt_settings.minimap_x > 1) { - qt_settings.chat_fx_pos = 0.84; - } - if (qt_settings.minimap_y < 0 || qt_settings.minimap_y > 1) { - qt_settings.chat_fx_pos = 0.79; - } } /** @@ -544,10 +516,6 @@ void fc_client::write_settings() s.setValue(QStringLiteral("help_splitter1"), qt_settings.help_splitter1); s.setValue(QStringLiteral("unit_fx"), qt_settings.unit_info_pos_fx); s.setValue(QStringLiteral("unit_fy"), qt_settings.unit_info_pos_fy); - s.setValue(QStringLiteral("minimap_x"), qt_settings.minimap_x); - s.setValue(QStringLiteral("minimap_y"), qt_settings.minimap_y); - s.setValue(QStringLiteral("minimap_width"), qt_settings.minimap_width); - s.setValue(QStringLiteral("minimap_height"), qt_settings.minimap_height); s.setValue(QStringLiteral("battlelog_scale"), qt_settings.battlelog_scale); s.setValue(QStringLiteral("battlelog_x"), qt_settings.battlelog_x); s.setValue(QStringLiteral("battlelog_y"), qt_settings.battlelog_y); diff --git a/client/fc_client.h b/client/fc_client.h index 16f8d4cc28..c9216a744a 100644 --- a/client/fc_client.h +++ b/client/fc_client.h @@ -65,10 +65,6 @@ struct fc_settings { QByteArray help_splitter1; float unit_info_pos_fx; float unit_info_pos_fy; - float minimap_x; - float minimap_y; - float minimap_width; - float minimap_height; float battlelog_scale; float battlelog_x; float battlelog_y; diff --git a/client/minimap.cpp b/client/minimap.cpp index 4b9af89a0d..781966cbeb 100644 --- a/client/minimap.cpp +++ b/client/minimap.cpp @@ -27,10 +27,6 @@ #include "page_game.h" #include "qtg_cxxside.h" -namespace { -const auto always_visible_margin = 15; -} - /** Constructor for minimap */ @@ -40,8 +36,6 @@ minimap_view::minimap_view(QWidget *parent) : fcwidget() setAttribute(Qt::WA_OpaquePaintEvent, true); w_ratio = 0.0; h_ratio = 0.0; - // Dark magic: This call is required for the widget to work. - resize(0, 0); background = QBrush(QColor(0, 0, 0)); setCursor(Qt::CrossCursor); pix = new QPixmap; @@ -226,25 +220,9 @@ void minimap_view::paint(QPainter *painter, QPaintEvent *event) */ void minimap_view::resizeEvent(QResizeEvent *event) { - auto size = event->size(); - - if (x() + size.width() < always_visible_margin) { - size.setWidth(always_visible_margin - x()); - resize(size); - } - if (y() + size.height() < always_visible_margin) { - size.setHeight(always_visible_margin - y()); - resize(size); - } - - if (C_S_RUNNING <= client_state() && size.width() > 0 - && size.height() > 0) { - w_ratio = static_cast(width()) / gui_options.overview.width; - h_ratio = static_cast(height()) / gui_options.overview.height; - king()->qt_settings.minimap_width = - static_cast(size.width()) / mapview.width; - king()->qt_settings.minimap_height = - static_cast(size.height()) / mapview.height; + if (C_S_RUNNING <= client_state() && !size().isEmpty()) { + w_ratio = static_cast(width()) / gui_options.overview.width; + h_ratio = static_cast(height()) / gui_options.overview.height; } update_image(); }