Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2014-09-06 13:54:20 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:26:10 +0300
commitd9ca6e56ef92b248221b66ab0f79437c573c469b (patch)
tree830f5d1ce26c3a0289fc2d8e7cfa04071d816c1c /map/country_status_display.cpp
parent573e647de3a22282d0e993c30ffa05f4075c1e93 (diff)
Minor refactoring of InformationDisplay:
- remove useless class data - do not recalculate layout on every frame draw; do it when size changed only - use unique_ptr instead of shared_ptr - remove useless includes
Diffstat (limited to 'map/country_status_display.cpp')
-rw-r--r--map/country_status_display.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/map/country_status_display.cpp b/map/country_status_display.cpp
index 5f08e7b5d1..c86fa40756 100644
--- a/map/country_status_display.cpp
+++ b/map/country_status_display.cpp
@@ -1,6 +1,7 @@
#include "country_status_display.hpp"
#include "../gui/controller.hpp"
+#include "../gui/text_view.hpp"
#include "../graphics/overlay_renderer.hpp"
@@ -11,6 +12,7 @@
#include "../std/bind.hpp"
#include "../std/sstream.hpp"
+
CountryStatusDisplay::Params::Params()
: m_storage(0)
{
@@ -147,25 +149,27 @@ CountryStatusDisplay::CountryStatusDisplay(Params const & p)
m_slotID = m_storage->Subscribe(bind(&CountryStatusDisplay::CountryStatusChanged, this, _1),
bind(&CountryStatusDisplay::CountryProgress, this, _1, _2));
+ using namespace graphics;
+
gui::Button::Params bp;
bp.m_depth = depth();
bp.m_minWidth = 200;
bp.m_minHeight = 40;
bp.m_pivot = m2::PointD(0, 0);
- bp.m_position = graphics::EPosCenter;
+ bp.m_position = EPosCenter;
bp.m_text = "Download";
m_downloadButton.reset(new gui::Button(bp));
m_downloadButton->setOnClickListener(bind(&CountryStatusDisplay::downloadCountry, this));
m_downloadButton->setIsVisible(false);
- m_downloadButton->setPosition(graphics::EPosCenter);
+ m_downloadButton->setPosition(EPosCenter);
- m_downloadButton->setFont(EActive, graphics::FontDesc(16, graphics::Color(255, 255, 255, 255)));
- m_downloadButton->setFont(EPressed, graphics::FontDesc(16, graphics::Color(255, 255, 255, 255)));
+ m_downloadButton->setFont(EActive, FontDesc(16, Color(255, 255, 255, 255)));
+ m_downloadButton->setFont(EPressed, FontDesc(16, Color(255, 255, 255, 255)));
- m_downloadButton->setColor(EActive, graphics::Color(graphics::Color(0, 0, 0, 0.6 * 255)));
- m_downloadButton->setColor(EPressed, graphics::Color(graphics::Color(0, 0, 0, 0.4 * 255)));
+ m_downloadButton->setColor(EActive, Color(Color(0, 0, 0, 0.6 * 255)));
+ m_downloadButton->setColor(EPressed, Color(Color(0, 0, 0, 0.4 * 255)));
gui::TextView::Params tp;
tp.m_depth = depth();
@@ -175,9 +179,9 @@ CountryStatusDisplay::CountryStatusDisplay(Params const & p)
m_statusMsg.reset(new gui::TextView(tp));
m_statusMsg->setIsVisible(false);
- m_statusMsg->setPosition(graphics::EPosCenter);
+ m_statusMsg->setPosition(EPosCenter);
- m_statusMsg->setFont(gui::Element::EActive, graphics::FontDesc(18));
+ m_statusMsg->setFont(gui::Element::EActive, FontDesc(18));
setIsVisible(false);