diff options
| author | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2016-05-30 09:48:32 +0300 |
|---|---|---|
| committer | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2016-05-30 09:48:32 +0300 |
| commit | aa7839f9905353fbec2d4573cc9bc47468cf284d (patch) | |
| tree | bce95a2c10f92246d5b738d5f4cfbf376c159db6 /dash | |
| parent | 6f6f04108d401cb6374859a52964f49c5217a7b2 (diff) | |
| parent | 1b50bc472726ded1db2db5d747be168a6867d2ca (diff) | |
merged to trunk
[ Eleni Maria Stea ] * PanelView: Don't draw it if the geo doesn't intersect the monitor geo (as in ezoom) [ Marco Trevisan (Treviño) ] * Bumping version to 7.5.0, as per 7.4 release [ Andrea Azzarone ] * Do not reset the shortcut for icons that have their own shortcut. (LP: #1562847) * Fallback to "background" class in case no background is specified for title bars and top panel. (LP: #1575527) * GnomeKeyGrabber: do not activate an action if it's a repeated one. (LP: #1572241) * Properly calculate array indexes to avoid crashes. (LP: #1570843) * Properly remove SoftwareCenterLauncherIcon in case of failure. (LP: #1553165) * Update ExpoLauncherIcon in case the quicklist is used to switch vp. (LP: #1525685) [ Marco Trevisan (Treviño) ] * DashStyle: ensure LazyLoadTexture disconnects from signals on destruction (LP: #1580212) * Releasing Unity 7.4.0 * SwitcherController: don't try to get a window from empty selections (LP: #1580211) * SwitcherView: close the mouse-selected application on middle-click (LP: #1574689) * UnityScreen, UnityWindow: cleanup a little the code, and ensure overridden CompositeWindow functions get actually called [ handsome_feng ] * Change the x_offset of expo when launcher position changed. (LP: #1573897, #1562348) [ Andrea Azzarone ] * Do not use pointers to LazyLoadTextures. (LP: #1569100) * Fix unity script crash. (LP: #1566565) * LockscreenController: Don't use SetActivate(False) for gnome- screensaver to prevent unlocking on tty switch. It will not only deactivate the screensaver but also unlock the screen. (LP: #1552537) * unityshell.xml: Fix typo (LP: #1559427) [ Andrea Azzarone ] * Improve the "lock on suspend" logic to always keep in sync the inhibitor with the lockscreen. [ Marco Trevisan (Treviño) ] * DecoratedWindow: Just send estimated extents on _NET_REQUEST_FRAME_EXTENTS (LP: #1368118) * TextureCache: add support for loading themed textures (LP: #903179, #1208790) * Unity: stop unity7 upstart instance if needed and restart it if not clearly requested (LP: #1555633) * ForceQuitDialog: set client leader [ Andrea Azzarone ] * ApplicationLauncherIcon: use the starting property to show an icon when launched (LP: #676457) [ Marco Trevisan (Treviño) ] * UserPromptView: don't hide local scale property (LP: #1551820) [ Sebastien Bacher ] * set the gettext domain directly in CMakeLists rather than using refering to the project name, the translation template is updated during the build by dh_translations which is not clever enough to understand the variable (LP: #1557081) [ handsome_feng ] * Dash: move it down when the launcher is positioned at the bottom. (LP: #1552630) * Launcher: add Bottom mode, so that the launcher can be positioned horisontally (LP: #1552630) [ Andrea Azzarone ] * Add a "Format..." option to volume icons. (LP: #1057008) [ Marco Trevisan (Treviño) ] * DashView: ensure that we update scaling when monitor changes (LP: #1546690) * DecoratedWindow: move the shadow under the window if we've a client- side decorated window with corners (LP: #1516403) * LauncherController: add overlay shortcut to all the WindowedLauncherIcon's we have * ThemeSettings: add small class for reading gtk settings for theming (LP: #1543757, #1288998) [ Andrea Azzarone, Didier Roche ] * Gnome-software launcher integration. [ Marco Trevisan (Treviño) ] * GnomeFileManager: use *WithTimestamp file operations instead of using Activate workaround (LP: #1445595) * unity.migrations: add 04_unity_update_software_center_desktop_file [ Robert Ancell ] * Drop unused build-dependency on libgee-dev. * Switch from Ubuntu Software Center to GNOME Software. (LP: #1547129) [ Didier Roche ] * debian: Recommends session-shortcuts, prodiving easy way to shutdown, reboot and logout from dash [ Marco Trevisan (Treviño) ] * CMake: use GNUInstallDirs with native multi-arch support (LP: #1508635, #1485668) * Launcher: add FileManager, Trash and Volume icons integration (LP: #1524721, #1161323, #1063838, #1063823) * SwitcherModel: avoid to access to invalid selection or to divide by zero (LP: #1537524) [ handsome_feng ] * Extend the lockscreen theme for kylin. * Multiarchify the library packages. (bzr r4067.7.11)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashController.cpp | 91 | ||||
| -rw-r--r-- | dash/DashController.h | 4 | ||||
| -rw-r--r-- | dash/DashView.cpp | 71 | ||||
| -rw-r--r-- | dash/DashView.h | 4 | ||||
| -rw-r--r-- | dash/FilterBasicButton.cpp | 1 | ||||
| -rwxr-xr-x | dash/PlacesGroup.cpp | 11 | ||||
| -rw-r--r-- | dash/PlacesGroup.h | 2 | ||||
| -rw-r--r-- | dash/ResultRendererTile.cpp | 6 | ||||
| -rw-r--r-- | dash/StandaloneDash.cpp | 2 | ||||
| -rw-r--r-- | dash/previews/StandaloneApplicationPreview.cpp | 35 | ||||
| -rw-r--r-- | dash/previews/StandaloneSocialPreview.cpp | 8 |
11 files changed, 142 insertions, 93 deletions
diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 55519d28b..589373b45 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -89,7 +89,8 @@ Controller::Controller(Controller::WindowCreator const& create_window) } SetupWindow(); - UScreen::GetDefault()->changed.connect([this] (int, std::vector<nux::Geometry> const&) { Relayout(true); }); + UScreen::GetDefault()->changed.connect(sigc::mem_fun(this, &Controller::OnMonitorChanged)); + Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &Controller::Relayout))); form_factor_changed_ = Settings::Instance().form_factor.changed.connect([this] (FormFactor) { @@ -177,7 +178,6 @@ void Controller::RegisterUBusInterests() HideDash(); } }); - } void Controller::EnsureDash() @@ -232,29 +232,61 @@ nux::Geometry Controller::GetIdealWindowGeometry() { UScreen *uscreen = UScreen::GetDefault(); auto monitor_geo = uscreen->GetMonitorGeometry(GetIdealMonitor()); - int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_); + int launcher_size = unity::Settings::Instance().LauncherSize(monitor_); // We want to cover as much of the screen as possible to grab any mouse events outside // of our window - return nux::Geometry (monitor_geo.x + launcher_width, - monitor_geo.y, - monitor_geo.width - launcher_width, - monitor_geo.height); + if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) + { + monitor_geo.x += launcher_size; + monitor_geo.width -= launcher_size; + } + else + { + monitor_geo.height -= launcher_size; + } + + return monitor_geo; } -void Controller::Relayout(bool check_monitor) +void Controller::OnMonitorChanged(int primary, std::vector<nux::Geometry> const& monitors) { - EnsureDash(); + if (!visible_ || !window_ || !view_) + return; - if (check_monitor) - monitor_ = CLAMP(GetIdealMonitor(), 0, static_cast<int>(UScreen::GetDefault()->GetMonitors().size()-1)); + monitor_ = std::min<int>(GetIdealMonitor(), monitors.size()-1); + view_->SetMonitor(monitor_); + Relayout(); +} - int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_); - nux::Geometry geo = GetIdealWindowGeometry(); +void Controller::Relayout() +{ + EnsureDash(); view_->Relayout(); - window_->SetGeometry(geo); - view_->SetMonitorOffset(launcher_width, panel::Style::Instance().PanelHeight(monitor_)); + window_->SetGeometry(GetIdealWindowGeometry()); + UpdateDashPosition(); +} + +void Controller::UpdateDashPosition() +{ + auto launcher_position = Settings::Instance().launcher_position(); + int left_offset = 0; + int top_offset = panel::Style::Instance().PanelHeight(monitor_); + int launcher_size = unity::Settings::Instance().LauncherSize(monitor_); + + if (launcher_position == LauncherPosition::LEFT) + { + left_offset = launcher_size; + } + else if (launcher_position == LauncherPosition::BOTTOM && + Settings::Instance().form_factor() == FormFactor::DESKTOP) + { + auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_); + top_offset = monitor_geo.height - view_->GetContentGeometry().height - launcher_size; + } + + view_->SetMonitorOffset(left_offset, top_offset); } void Controller::OnMouseDownOutsideWindow(int x, int y, @@ -308,18 +340,17 @@ bool Controller::ShowDash() return false; } + screen_ungrabbed_slot_->disconnect(); wm.SaveInputFocus(); EnsureDash(); monitor_ = GetIdealMonitor(); - screen_ungrabbed_slot_->disconnect(); - int launcher_width = unity::Settings::Instance().LauncherWidth(monitor_); - view_->SetMonitorOffset(launcher_width, panel::Style::Instance().PanelHeight(monitor_)); - view_->AboutToShow(monitor_); + view_->SetMonitor(monitor_); + view_->AboutToShow(); + UpdateDashPosition(); FocusWindow(); visible_ = true; - StartShowHideTimeline(); nux::Geometry const& view_content_geo = view_->GetContentGeometry(); @@ -465,13 +496,29 @@ bool Controller::IsCommandLensOpen() const nux::Geometry Controller::GetInputWindowGeometry() { EnsureDash(); + int launcher_size = Settings::Instance().LauncherSize(monitor_); + auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_); dash::Style& style = dash::Style::Instance(); nux::Geometry const& window_geo(window_->GetGeometry()); nux::Geometry const& view_content_geo(view_->GetContentGeometry()); nux::Geometry geo(window_geo.x, window_geo.y, view_content_geo.width, view_content_geo.height); - geo.width += style.GetDashRightTileWidth().CP(view_->scale()); - geo.height += style.GetDashBottomTileHeight().CP(view_->scale()); + + if (Settings::Instance().form_factor() == FormFactor::DESKTOP) + { + geo.width += style.GetDashVerticalBorderWidth().CP(view_->scale()); + geo.height += style.GetDashHorizontalBorderHeight().CP(view_->scale()); + + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) + geo.y = monitor_geo.height - view_content_geo.height - launcher_size - style.GetDashHorizontalBorderHeight().CP(view_->scale()); + } + else if (Settings::Instance().form_factor() == FormFactor::NETBOOK) + { + geo.height = monitor_geo.height; + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) + geo.height -= launcher_size; + } + return geo; } diff --git a/dash/DashController.h b/dash/DashController.h index 6228a458e..686871d50 100644 --- a/dash/DashController.h +++ b/dash/DashController.h @@ -82,7 +82,9 @@ private: nux::Geometry GetIdealWindowGeometry(); int GetIdealMonitor(); - void Relayout(bool check_monitor =false); + void OnMonitorChanged(int primary, std::vector<nux::Geometry> const&); + void UpdateDashPosition(); + void Relayout(); void OnMouseDownOutsideWindow(int x, int y, unsigned long bflags, unsigned long kflags); void OnExternalShowDash(GVariant* variant); diff --git a/dash/DashView.cpp b/dash/DashView.cpp index 391ffe625..d1aa1f512 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -133,16 +133,15 @@ DashView::DashView(Scopes::Ptr const& scopes, ApplicationStarter::Ptr const& app , monitor_(0) { renderer_.SetOwner(this); + renderer_.owner_type = OverlayOwner::Dash; renderer_.need_redraw.connect([this] () { QueueDraw(); }); SetupViews(); SetupUBusConnections(); - AddChild(overlay_window_buttons_.GetPointer()); - mouse_down.connect(sigc::mem_fun(this, &DashView::OnMouseButtonDown)); preview_state_machine_.PreviewActivated.connect(sigc::mem_fun(this, &DashView::BuildPreview)); if (scopes_) @@ -169,6 +168,15 @@ DashView::~DashView() RemoveLayout(); } +void DashView::SetMonitor(int monitor) +{ + if (monitor_== monitor) + return; + + monitor_ = monitor; + scale = Settings::Instance().em(monitor_)->DPIScale(); +} + void DashView::SetMonitorOffset(int x, int y) { renderer_.x_offset = x; @@ -460,17 +468,11 @@ void DashView::OnPreviewAnimationFinished() content_view_->SetPresentRedirectedView(true); } -void DashView::AboutToShow(int monitor) +void DashView::AboutToShow() { visible_ = true; search_bar_->text_entry()->SelectAll(); - if (monitor_ != monitor) - { - monitor_ = monitor; - scale = Settings::Instance().em(monitor_)->DPIScale(); - } - /* Give the scopes a chance to prep data before we map them */ if (active_scope_view_) { @@ -614,7 +616,7 @@ void DashView::SetupUBusConnections() sigc::mem_fun(this, &DashView::OnActivateRequest)); } -long DashView::PostLayoutManagement (long LayoutResult) +long DashView::PostLayoutManagement(long LayoutResult) { Relayout(); return LayoutResult; @@ -649,7 +651,20 @@ void DashView::Relayout() ubus_manager_.SendMessage(UBUS_DASH_SIZE_CHANGED, g_variant_new("(ii)", content_geo_.width, content_geo_.height)); if (preview_displaying_) - preview_container_->SetGeometry(layout_->GetGeometry()); + { + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) + { + auto preview_geo = content_geo_; + int padding = style.GetDashHorizontalBorderHeight().CP(scale()); + preview_geo.y += padding; + preview_geo.height -= padding; + preview_container_->SetGeometry(preview_geo); + } + else + { + preview_container_->SetGeometry(layout_->GetGeometry()); + } + } renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false); @@ -662,7 +677,12 @@ void DashView::Relayout() nux::Geometry DashView::GetBestFitGeometry(nux::Geometry const& for_geo) { dash::Style& style = dash::Style::Instance(); - int panel_height = renderer_.y_offset; + int vertical_offset = renderer_.y_offset; + + if (style.always_maximised) + { + return nux::Geometry(0, vertical_offset, for_geo.width, for_geo.height - vertical_offset); + } int width = 0, height = 0; int tile_width = style.GetTileWidth().CP(scale); @@ -689,14 +709,9 @@ nux::Geometry DashView::GetBestFitGeometry(nux::Geometry const& for_geo) // width/height shouldn't be bigger than the geo available. width = std::min(width, for_geo.width); // launcher width is taken into account in for_geo. - height = std::min(height, for_geo.height - panel_height); // panel height is not taken into account in for_geo. + height = std::min(height, for_geo.height - vertical_offset); // panel height is not taken into account in for_geo. - if (style.always_maximised) - { - width = std::max(0, for_geo.width); - height = std::max(0, for_geo.height - panel_height); - } - return nux::Geometry(0, panel_height, width, height); + return nux::Geometry(0, vertical_offset, width, height); } void DashView::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) @@ -728,6 +743,8 @@ void DashView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw // See lp bug: 1125346 (The sharp white line between dash and launcher is missing) nux::Geometry clip_geo = geo_layout; clip_geo.x += 1; + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) + clip_geo.y += renderer_y_offset; graphics_engine.PushClippingRectangle(clip_geo); if (IsFullRedraw()) @@ -1119,18 +1136,6 @@ void DashView::DrawPreview(nux::GraphicsEngine& graphics_engine, bool force_draw } } -void DashView::OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key) -{ - nux::Geometry geo(content_geo_); - - if (Settings::Instance().form_factor() == FormFactor::DESKTOP) - { - dash::Style& style = dash::Style::Instance(); - geo.width += style.GetDashRightTileWidth().CP(scale); - geo.height += style.GetDashBottomTileHeight().CP(scale); - } -} - void DashView::OnActivateRequest(GVariant* args) { glib::String uri; @@ -1508,8 +1513,8 @@ void DashView::AddProperties(debug::IntrospectionData& introspection) introspection.add(nux::Geometry(GetAbsoluteX(), GetAbsoluteY(), content_geo_.width, content_geo_.height)) .add("num_rows", num_rows) .add("form_factor", form_factor) - .add("right-border-width", style.GetDashRightTileWidth().CP(scale)) - .add("bottom-border-height", style.GetDashBottomTileHeight().CP(scale)) + .add("vertical-border-width", style.GetDashVerticalBorderWidth().CP(scale)) + .add("horizontal-border-height", style.GetDashHorizontalBorderHeight().CP(scale)) .add("preview_displaying", preview_displaying_) .add("preview_animation", animate_split_value_ * animate_preview_container_value_ * animate_preview_value_) .add("dash_maximized", style.always_maximised()) diff --git a/dash/DashView.h b/dash/DashView.h index cdcf70767..95f485157 100644 --- a/dash/DashView.h +++ b/dash/DashView.h @@ -64,11 +64,12 @@ public: nux::Property<double> scale; - void AboutToShow(int monitor); + void AboutToShow(); void AboutToHide(); void Relayout(); void DisableBlur(); void OnActivateRequest(GVariant* args); + void SetMonitor(int monitor); void SetMonitorOffset(int x, int y); bool IsCommandLensOpen() const; @@ -108,7 +109,6 @@ private: void BuildPreview(Preview::Ptr model); void ClosePreview(); void OnPreviewAnimationFinished(); - void OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key); void OnBackgroundColorChanged(GVariant* args); void OnSearchChanged(std::string const& search_string); void OnLiveSearchReached(std::string const& search_string); diff --git a/dash/FilterBasicButton.cpp b/dash/FilterBasicButton.cpp index 727be89dc..a1466a6ac 100644 --- a/dash/FilterBasicButton.cpp +++ b/dash/FilterBasicButton.cpp @@ -72,6 +72,7 @@ FilterBasicButton::FilterBasicButton(std::string const& label, nux::TextureArea* scale.changed.connect(sigc::mem_fun(this, &FilterBasicButton::UpdateScale)); Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &FilterBasicButton::InitTheme))); + Style::Instance().changed.connect(sigc::mem_fun(this, &FilterBasicButton::InitTheme)); } void FilterBasicButton::InitTheme() diff --git a/dash/PlacesGroup.cpp b/dash/PlacesGroup.cpp index 3aafc78f9..3eb5b9e02 100755 --- a/dash/PlacesGroup.cpp +++ b/dash/PlacesGroup.cpp @@ -130,16 +130,13 @@ PlacesGroup::PlacesGroup(dash::StyleInterface& style) SetAcceptKeyNavFocusOnMouseEnter(false); scale.changed.connect(sigc::mem_fun(this, &PlacesGroup::UpdateScale)); - _background = _style.GetCategoryBackground().GetPointer(); - _background_nofilters = _style.GetCategoryBackgroundNoFilters().GetPointer(); - nux::ROPConfig rop; rop.Blend = true; rop.SrcBlend = GL_ONE; rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; nux::TexCoordXForm texxform; - _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(), + _background_layer.reset(new nux::TextureLayer(_style.GetCategoryBackgroundNoFilters()->GetDeviceTexture(), texxform, nux::color::White, false, @@ -502,7 +499,7 @@ void PlacesGroup::Draw(nux::GraphicsEngine& graphics_engine, // to render into a space left over by the scrollview (1 has NOT to be scaled) bg_geo.width = std::min(bg_width, bg_geo.GetWidth()) + 1; - bg_geo.height = _background->GetHeight(); + bg_geo.height = _background_layer->GetDeviceTexture()->GetHeight(); _background_layer->SetGeometry(bg_geo); _background_layer->Renderlayer(graphics_engine); @@ -681,7 +678,7 @@ void PlacesGroup::SetFiltersExpanded(bool filters_expanded) nux::TexCoordXForm texxform; if (filters_expanded && !_using_filters_background) { - _background_layer.reset(new nux::TextureLayer(_background->GetDeviceTexture(), + _background_layer.reset(new nux::TextureLayer(_style.GetCategoryBackground()->GetDeviceTexture(), texxform, nux::color::White, false, @@ -689,7 +686,7 @@ void PlacesGroup::SetFiltersExpanded(bool filters_expanded) } else if (!filters_expanded && _using_filters_background) { - _background_layer.reset(new nux::TextureLayer(_background_nofilters->GetDeviceTexture(), + _background_layer.reset(new nux::TextureLayer(_style.GetCategoryBackgroundNoFilters()->GetDeviceTexture(), texxform, nux::color::White, false, diff --git a/dash/PlacesGroup.h b/dash/PlacesGroup.h index 6b1295b95..e915b1dfe 100644 --- a/dash/PlacesGroup.h +++ b/dash/PlacesGroup.h @@ -150,8 +150,6 @@ private: StaticCairoText* _expand_label; IconTexture* _expand_icon; - nux::BaseTexture* _background; - nux::BaseTexture* _background_nofilters; bool _using_filters_background; std::unique_ptr<nux::TextureLayer> _background_layer; diff --git a/dash/ResultRendererTile.cpp b/dash/ResultRendererTile.cpp index 83abd127e..602c85057 100644 --- a/dash/ResultRendererTile.cpp +++ b/dash/ResultRendererTile.cpp @@ -32,6 +32,7 @@ #include "unity-shared/DashStyle.h" #include "unity-shared/TextureCache.h" #include "unity-shared/UnitySettings.h" +#include "unity-shared/ThemeSettings.h" namespace unity { @@ -465,13 +466,10 @@ void ResultRendererTile::LoadText(Result const& row) PangoFontDescription* desc = NULL; PangoContext* pango_context = NULL; GdkScreen* screen = gdk_screen_get_default(); // not ref'ed - glib::String font; - - g_object_get(gtk_settings_get_default(), "gtk-font-name", &font, NULL); cairo_set_font_options(cr, gdk_screen_get_font_options(screen)); layout = pango_cairo_create_layout(cr); - desc = pango_font_description_from_string(font.Value()); + desc = pango_font_description_from_string(theme::Settings::Get()->font().c_str()); pango_font_description_set_size (desc, FONT_SIZE * FONT_MULTIPLIER); pango_layout_set_font_description(layout, desc); diff --git a/dash/StandaloneDash.cpp b/dash/StandaloneDash.cpp index 81b0a6aa1..4f0a03d76 100644 --- a/dash/StandaloneDash.cpp +++ b/dash/StandaloneDash.cpp @@ -74,7 +74,7 @@ void TestRunner::Init () layout->AddView (view, 1, nux::MINOR_POSITION_CENTER); layout->SetMinMaxSize(WIDTH.CP(scale_), HEIGHT.CP(scale_)); - view->AboutToShow(0); + view->AboutToShow(); nux::GetWindowThread()->SetLayout (layout); nux::GetWindowCompositor().SetKeyFocusArea(view->default_focus()); diff --git a/dash/previews/StandaloneApplicationPreview.cpp b/dash/previews/StandaloneApplicationPreview.cpp index e4431b3b5..e24f5acaa 100644 --- a/dash/previews/StandaloneApplicationPreview.cpp +++ b/dash/previews/StandaloneApplicationPreview.cpp @@ -17,7 +17,8 @@ * Authored by: Nick Dedekind <nick.dedekind@canonical.com> * */ -#include <gtk/gtk.h> + +#include "config.h" #include "Nux/Nux.h" #include "Nux/VLayout.h" @@ -165,23 +166,23 @@ void TestRunner::Init () description << "Application description " << i << std::endl; // creates a generic preview object - glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-music.svg", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); - glib::Object<GIcon> iconHint3(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-people.svg", NULL)); + glib::Object<GIcon> iconHint1(g_icon_new_for_string(PKGDATADIR"/lens-nav-music.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint3(g_icon_new_for_string(PKGDATADIR"/lens-nav-people.svg", NULL)); GHashTable* action_hints1(g_hash_table_new(g_direct_hash, g_direct_equal)); g_hash_table_insert (action_hints1, g_strdup ("extra-text"), g_variant_new_string("£30.99")); glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_application_preview_new())); - unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string("/home/nick/SkypeIcon.png", NULL)); + unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string(PKGDATADIR "/launcher_bfb.png", NULL)); unity_protocol_application_preview_set_license(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "Proprietary"); unity_protocol_application_preview_set_copyright(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "(c) Skype 2012"); unity_protocol_application_preview_set_last_update(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "11th Apr 2012"); unity_protocol_application_preview_set_rating(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 0.5); unity_protocol_application_preview_set_num_ratings(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 17); - unity_protocol_preview_set_image_source_uri(proto_obj, "file:///home/nick/Skype.png"); + unity_protocol_preview_set_image_source_uri(proto_obj, "file://" PKGDATADIR "/launcher_bfb.png"); unity_protocol_preview_set_title(proto_obj, app_name.str().c_str()); unity_protocol_preview_set_subtitle(proto_obj, subtitle); unity_protocol_preview_set_description(proto_obj, description.str().c_str()); @@ -210,24 +211,24 @@ void TestRunner::NavRight() The service allows users to communicate with peers by voice, video, and instant messaging over the Internet. Phone calls may be placed to recipients on the traditional telephone networks. Calls to other users within the Skype service are free of charge, while calls to landline telephones and mobile phones are charged via a debit-based user account system."; // creates a generic preview object - glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-music.svg", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); - glib::Object<GIcon> iconHint3(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-people.svg", NULL)); - glib::Object<GIcon> iconHint4(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-people.svg", NULL)); + glib::Object<GIcon> iconHint1(g_icon_new_for_string(PKGDATADIR"/lens-nav-music.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint3(g_icon_new_for_string(PKGDATADIR"/lens-nav-people.svg", NULL)); + glib::Object<GIcon> iconHint4(g_icon_new_for_string(PKGDATADIR"/lens-nav-people.svg", NULL)); GHashTable* action_hints1(g_hash_table_new(g_direct_hash, g_direct_equal)); g_hash_table_insert (action_hints1, g_strdup ("extra-text"), g_variant_new_string("£30.99")); glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_application_preview_new())); - unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string("/home/nick/SkypeIcon.png", NULL)); + unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string(PKGDATADIR "/launcher_bfb.png", NULL)); unity_protocol_application_preview_set_license(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "Proprietary"); unity_protocol_application_preview_set_copyright(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "(c) Skype 2012"); unity_protocol_application_preview_set_last_update(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "11th Apr 2012"); unity_protocol_application_preview_set_rating(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 0.25); unity_protocol_application_preview_set_num_ratings(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 5); - unity_protocol_preview_set_image_source_uri(proto_obj, "file:///home/nick/Skype.png"); + unity_protocol_preview_set_image_source_uri(proto_obj, "file://" PKGDATADIR "/launcher_bfb.png"); unity_protocol_preview_set_title(proto_obj, app_name.str().c_str()); unity_protocol_preview_set_subtitle(proto_obj, subtitle); unity_protocol_preview_set_description(proto_obj, description); @@ -262,9 +263,9 @@ void TestRunner::NavLeft() The service allows users to communicate with peers by voice, video, and instant messaging over the Internet. Phone calls may be placed to recipients on the traditional telephone networks. Calls to other users within the Skype service are free of charge, while calls to landline telephones and mobile phones are charged via a debit-based user account system."; // creates a generic preview object - glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-music.svg", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); - glib::Object<GIcon> iconHint3(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-people.svg", NULL)); + glib::Object<GIcon> iconHint1(g_icon_new_for_string(PKGDATADIR"/lens-nav-music.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint3(g_icon_new_for_string(PKGDATADIR"/lens-nav-people.svg", NULL)); GHashTable* action_hints1(g_hash_table_new(g_direct_hash, g_direct_equal)); g_hash_table_insert (action_hints1, g_strdup ("extra-text"), g_variant_new_string("£30.99")); @@ -272,14 +273,14 @@ void TestRunner::NavLeft() glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_application_preview_new())); - unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string("/home/nick/SkypeIcon.png", NULL)); + unity_protocol_application_preview_set_app_icon(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), g_icon_new_for_string(PKGDATADIR"/launcher_bfb.png", NULL)); unity_protocol_application_preview_set_license(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "Proprietary"); unity_protocol_application_preview_set_copyright(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "(c) Skype 2012"); unity_protocol_application_preview_set_last_update(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), "11th Apr 2012"); unity_protocol_application_preview_set_rating(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 0.8); unity_protocol_application_preview_set_num_ratings(UNITY_PROTOCOL_APPLICATION_PREVIEW(proto_obj.RawPtr()), 1223); - unity_protocol_preview_set_image_source_uri(proto_obj, "file:///home/nick/Skype.png"); + unity_protocol_preview_set_image_source_uri(proto_obj, "file://" PKGDATADIR "/launcher_bfb.png"); unity_protocol_preview_set_title(proto_obj, app_name.str().c_str()); unity_protocol_preview_set_subtitle(proto_obj, subtitle); unity_protocol_preview_set_description(proto_obj, description); diff --git a/dash/previews/StandaloneSocialPreview.cpp b/dash/previews/StandaloneSocialPreview.cpp index 1eb2b77db..a73d9ba56 100644 --- a/dash/previews/StandaloneSocialPreview.cpp +++ b/dash/previews/StandaloneSocialPreview.cpp @@ -17,7 +17,7 @@ * Authored by: Nick Dedekind <nick.dedekind@canonical.com> * */ -#include <gtk/gtk.h> +#include "config.h" #include "Nux/Nux.h" #include "Nux/VLayout.h" @@ -159,7 +159,7 @@ void TestRunner::Init () const char* description = "Lorem ipsum dolor sit amet, id eruditi referrentur cum, et est enim persequeris. Munere docendi intellegebat pro id, nam no delenit facilisis similique, ut usu eros aliquando. Electram postulant accusamus ut ius, cum ad impedit facilis mediocrem. At cum tamquam."; glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/pixmaps/faces/sunflower.jpg", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); glib::Object<GIcon> iconHint3(g_icon_new_for_string("/usr/share/icons/unity-icon-theme/places/svg/service-twitter.svg", NULL)); glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_social_preview_new())); @@ -193,7 +193,7 @@ void TestRunner::NavRight() // creates a generic preview object glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/pixmaps/faces/astronaut.jpg", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_social_preview_new())); @@ -228,7 +228,7 @@ void TestRunner::NavLeft() const char* description = "Profile pictures are what people want them to think they look like. Tagged pictures are what they really look like."; glib::Object<GIcon> iconHint1(g_icon_new_for_string("/usr/share/pixmaps/faces/soccerball.png", NULL)); - glib::Object<GIcon> iconHint2(g_icon_new_for_string("/usr/share/unity/icons/lens-nav-home.svg", NULL)); + glib::Object<GIcon> iconHint2(g_icon_new_for_string(PKGDATADIR"/lens-nav-home.svg", NULL)); glib::Object<UnityProtocolPreview> proto_obj(UNITY_PROTOCOL_PREVIEW(unity_protocol_social_preview_new())); |
