summaryrefslogtreecommitdiff
path: root/launcher
diff options
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Launcher.cpp5
-rw-r--r--launcher/StandaloneSwitcher.cpp2
-rw-r--r--launcher/SwitcherController.cpp12
-rw-r--r--launcher/SwitcherView.cpp24
-rw-r--r--launcher/SwitcherView.h2
5 files changed, 23 insertions, 22 deletions
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index f881703d3..d41247c41 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -1680,16 +1680,15 @@ void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
{
if (IsOverlayOpen() && bg_effect_helper_.enabled)
{
- nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, base.width, base.height);
nux::ObjectPtr<nux::IOpenGLBaseTexture> blur_texture;
if (BackgroundEffectHelper::blur_type != unity::BLUR_NONE && (bkg_box.x + bkg_box.width > 0))
{
- blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo);
+ blur_texture = bg_effect_helper_.GetBlurRegion();
}
else
{
- blur_texture = bg_effect_helper_.GetRegion(blur_geo);
+ blur_texture = bg_effect_helper_.GetRegion();
}
if (blur_texture.IsValid())
diff --git a/launcher/StandaloneSwitcher.cpp b/launcher/StandaloneSwitcher.cpp
index 7adee5829..8499cc150 100644
--- a/launcher/StandaloneSwitcher.cpp
+++ b/launcher/StandaloneSwitcher.cpp
@@ -292,7 +292,7 @@ int main(int argc, char** argv)
nux::NuxInitialize(0);
unity::Settings settings;
- BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
+ unity::BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Unity Switcher"), 1200, 600, 0, &ThreadWidgetInit, 0);
nux::NuxTimerTickSource tick_source;
nux::animation::AnimationController animation_controller(tick_source);
diff --git a/launcher/SwitcherController.cpp b/launcher/SwitcherController.cpp
index 05ba0d7c2..4808b7634 100644
--- a/launcher/SwitcherController.cpp
+++ b/launcher/SwitcherController.cpp
@@ -44,7 +44,6 @@ const std::string DETAIL_TIMEOUT = "detail-timeout";
const std::string VIEW_CONSTRUCT_IDLE = "view-construct-idle";
const unsigned FADE_DURATION = 80;
const int XY_OFFSET = 100;
-const int WH_OFFSET = -200;
/**
* Helper comparison functor for sorting application icons.
@@ -440,8 +439,7 @@ nux::Geometry GetSwitcherViewsGeometry()
int monitor = uscreen->GetMonitorWithMouse();
auto monitor_geo = uscreen->GetMonitorGeometry(monitor);
- monitor_geo.OffsetPosition(XY_OFFSET, XY_OFFSET);
- monitor_geo.OffsetSize(WH_OFFSET, WH_OFFSET);
+ monitor_geo.Expand(-XY_OFFSET, -XY_OFFSET);
return monitor_geo;
}
@@ -462,13 +460,13 @@ void Controller::Impl::ConstructView()
view_->hide_request.connect(sigc::mem_fun(this, &Controller::Impl::Hide));
view_->switcher_mouse_up.connect([this] (int icon_index, int button) {
- if (button == 3)
- InitiateDetail(true);
+ if (button == 3)
+ InitiateDetail(true);
});
view_->switcher_mouse_move.connect([this] (int icon_index) {
- if (icon_index >= 0)
- ResetDetailTimer(obj_->detail_timeout_length);
+ if (icon_index >= 0)
+ ResetDetailTimer(obj_->detail_timeout_length);
});
view_->switcher_next.connect(sigc::mem_fun(this, &Impl::Next));
diff --git a/launcher/SwitcherView.cpp b/launcher/SwitcherView.cpp
index 7b6b33f95..eb75a37d9 100644
--- a/launcher/SwitcherView.cpp
+++ b/launcher/SwitcherView.cpp
@@ -38,7 +38,7 @@ namespace
unsigned int const VERTICAL_PADDING = 45;
unsigned int const SPREAD_OFFSET = 100;
unsigned int const EXTRA_ICON_SPACE = 10;
- unsigned int const MAX_DIRECTIONS_CHANGED = 3;
+ unsigned int const MAX_DIRECTIONS_CHANGED = 3;
}
NUX_IMPLEMENT_OBJECT_TYPE(SwitcherView);
@@ -60,11 +60,11 @@ SwitcherView::SwitcherView()
, text_view_(new StaticCairoText(""))
, last_icon_selected_(-1)
, last_detail_icon_selected_(-1)
- , target_sizes_set_(false)
, check_mouse_first_time_(true)
{
icon_renderer_->pip_style = OVER_TILE;
icon_renderer_->monitor = monitors::MAX;
+ icon_renderer_->SetTargetSize(tile_size, icon_size, minimum_spacing);
text_view_->SetMaximumWidth(tile_size * spread_size);
text_view_->SetLines(1);
@@ -87,6 +87,7 @@ SwitcherView::SwitcherView()
if (enabled)
{
SaveTime();
+ QueueRelayout();
QueueDraw();
}
else
@@ -198,7 +199,8 @@ void SwitcherView::SaveLast()
void SwitcherView::OnDetailSelectionIndexChanged(unsigned int index)
{
- QueueDraw ();
+ QueueRelayout();
+ QueueDraw();
}
void SwitcherView::OnDetailSelectionChanged(bool detail)
@@ -215,6 +217,7 @@ void SwitcherView::OnDetailSelectionChanged(bool detail)
}
SaveLast();
+ QueueRelayout();
QueueDraw();
}
@@ -226,6 +229,7 @@ void SwitcherView::OnSelectionChanged(AbstractLauncherIcon::Ptr const& selection
delta_tracker_.ResetState();
SaveLast();
+ QueueRelayout();
QueueDraw();
}
@@ -844,20 +848,19 @@ double SwitcherView::GetCurrentProgress()
return std::min<double>(1.0f, ms_since_change / static_cast<double>(animation_length()));
}
-void SwitcherView::PreDraw(nux::GraphicsEngine& GfxContext, bool force_draw)
+void SwitcherView::PreLayoutManagement()
{
- double progress = GetCurrentProgress();
+ UnityWindowView::PreLayoutManagement();
- if (!target_sizes_set_)
- {
- icon_renderer_->SetTargetSize(tile_size, icon_size, minimum_spacing);
- target_sizes_set_ = true;
- }
+ double progress = GetCurrentProgress();
nux::Geometry background_geo;
last_args_ = RenderArgsFlat(background_geo, model_->SelectionIndex(), progress);
last_background_ = background_geo;
+}
+void SwitcherView::PreDraw(nux::GraphicsEngine& GfxContext, bool force_draw)
+{
icon_renderer_->PreprocessIcons(last_args_, GetGeometry());
}
@@ -932,6 +935,7 @@ void SwitcherView::DrawOverlay(nux::GraphicsEngine& GfxContext, bool force_draw,
if (ms_since_change < animation_length && !redraw_idle_)
{
redraw_idle_.reset(new glib::Idle([this] () {
+ QueueRelayout();
QueueDraw();
redraw_idle_.reset();
return false;
diff --git a/launcher/SwitcherView.h b/launcher/SwitcherView.h
index 90737bdaa..0c90b9436 100644
--- a/launcher/SwitcherView.h
+++ b/launcher/SwitcherView.h
@@ -108,6 +108,7 @@ protected:
ui::RenderArg CreateBaseArgForIcon(launcher::AbstractLauncherIcon::Ptr const& icon);
+ virtual void PreLayoutManagement();
virtual bool InspectKeyEvent(unsigned int eventType, unsigned int keysym, const char* character);
virtual nux::Area* FindKeyFocusArea(unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state);
@@ -157,7 +158,6 @@ private:
int last_icon_selected_;
int last_detail_icon_selected_;
- bool target_sizes_set_;
bool check_mouse_first_time_;
DeltaTracker delta_tracker_;