Merge lp:~brandontschaefer/unity/lp.834465-fix-ABI-BREAK-FIX into lp:unity

Proposed by Brandon Schaefer
Status: Needs review
Proposed branch: lp:~brandontschaefer/unity/lp.834465-fix-ABI-BREAK-FIX
Merge into: lp:unity
Diff against target: 97 lines (+23/-3)
4 files modified
unity-shared/SearchBar.cpp (+7/-0)
unity-shared/SearchBar.h (+1/-0)
unity-shared/UnitySettings.cpp (+14/-3)
unity-shared/UnitySettings.h (+1/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.834465-fix-ABI-BREAK-FIX
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Marco Trevisan (Treviño) Needs Fixing
Review via email: mp+258323@code.launchpad.net

Commit message

Update the search bar cursor blinking speed based on the GNOME cursor blink speed setting.

Description of the change

Update the search bar cursor blinking speed based on the GNOME cursor blink speed setting.

This fixes the ABI break caused by this branch:
https://code.launchpad.net/~brandontschaefer/nux/lp.834465-fix-ABI-BREAK/+merge/258321

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I think you should do this inside IMTextEntry instead since it's the lower level class that we share between all the the text fields (not only the search bar, but also the spread filter and lockscreen inputs).

At this point, I think you can avoid to put this inside UnitySettings at all, since I don't think we need to use this setting everywhere else, so I'd just modify that class.

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ah, also... Since we're there, read the bool setting "cursor-blink", and if it's false we've not to blink at all.

So, in this case we might pass to nux a 0 (or -1) blinking time (and make nux to create no timeout at all in that case).

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Good idea about the cursor blink and false.

The only reason I put it in UnitySettings was because the gnome_settings_ui was already set up and the signals were already set up. Though I can re-do those bit else where so we dont expose the blink cursor speed.

3956. By Brandon Schaefer

* Do the ABI Fix in a different branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

3956. By Brandon Schaefer

* Do the ABI Fix in a different branch

3955. By Brandon Schaefer

* Use the GNOME cursor blink speed for the TextEntry used in the all the SearchBars

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'unity-shared/SearchBar.cpp'
--- unity-shared/SearchBar.cpp 2015-04-24 12:58:20 +0000
+++ unity-shared/SearchBar.cpp 2015-05-26 19:14:24 +0000
@@ -271,6 +271,7 @@
271 showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));271 showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));
272 scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale));272 scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale));
273 Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize)));273 Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize)));
274 Settings::Instance().cursor_blink_speed.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateBlinkSpeed)));
274 can_refine_search.changed.connect([this] (bool can_refine)275 can_refine_search.changed.connect([this] (bool can_refine)
275 {276 {
276 if (show_filter_hint_)277 if (show_filter_hint_)
@@ -343,6 +344,12 @@
343 SetMaximumHeight(search_bar_height);344 SetMaximumHeight(search_bar_height);
344}345}
345346
347void SearchBar::UpdateBlinkSpeed()
348{
349 unsigned blink_speed = Settings::Instance().cursor_blink_speed();
350 pango_entry_->SetCursorBlinkSpeed(blink_speed);
351}
352
346void SearchBar::UpdateScale(double scale)353void SearchBar::UpdateScale(double scale)
347{354{
348 hint_->SetMinimumSize(nux::AREA_MIN_WIDTH, nux::AREA_MIN_HEIGHT);355 hint_->SetMinimumSize(nux::AREA_MIN_WIDTH, nux::AREA_MIN_HEIGHT);
349356
=== modified file 'unity-shared/SearchBar.h'
--- unity-shared/SearchBar.h 2015-04-24 12:58:20 +0000
+++ unity-shared/SearchBar.h 2015-05-26 19:14:24 +0000
@@ -98,6 +98,7 @@
9898
99 bool ShouldBeHighlighted();99 bool ShouldBeHighlighted();
100 void UpdateSearchBarSize();100 void UpdateSearchBarSize();
101 void UpdateBlinkSpeed();
101 void UpdateScale(double scale);102 void UpdateScale(double scale);
102103
103 std::unique_ptr<nux::AbstractPaintLayer> bg_layer_;104 std::unique_ptr<nux::AbstractPaintLayer> bg_layer_;
104105
=== modified file 'unity-shared/UnitySettings.cpp'
--- unity-shared/UnitySettings.cpp 2015-05-22 13:20:22 +0000
+++ unity-shared/UnitySettings.cpp 2015-05-26 19:14:24 +0000
@@ -53,9 +53,10 @@
53const std::string UBUNTU_UI_SETTINGS = "com.ubuntu.user-interface";53const std::string UBUNTU_UI_SETTINGS = "com.ubuntu.user-interface";
54const std::string SCALE_FACTOR = "scale-factor";54const std::string SCALE_FACTOR = "scale-factor";
5555
56const std::string GNOME_UI_SETTINGS = "org.gnome.desktop.interface";56const std::string GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
57const std::string GNOME_FONT_NAME = "font-name";57const std::string GNOME_FONT_NAME = "font-name";
58const std::string GNOME_CURSOR_SIZE = "cursor-size";58const std::string GNOME_CURSOR_SIZE = "cursor-size";
59const std::string GNOME_CURSOR_BLINK = "cursor-blink-time";
59const std::string GNOME_SCALE_FACTOR = "scaling-factor";60const std::string GNOME_SCALE_FACTOR = "scaling-factor";
60const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";61const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
6162
@@ -142,6 +143,10 @@
142 }143 }
143 });144 });
144145
146 signals_.Add<void, GSettings*, const gchar*>(gnome_ui_settings_, "changed::" + GNOME_CURSOR_BLINK, [this] (GSettings*, const gchar* t) {
147 UpdateCursorBlinkSpeed();
148 });
149
145 signals_.Add<void, GSettings*, const gchar*>(lim_settings_, "changed", [this] (GSettings*, const gchar*) {150 signals_.Add<void, GSettings*, const gchar*>(lim_settings_, "changed", [this] (GSettings*, const gchar*) {
146 UpdateLimSetting();151 UpdateLimSetting();
147 });152 });
@@ -153,6 +158,7 @@
153 UScreen::GetDefault()->changed.connect(sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateDPI))));158 UScreen::GetDefault()->changed.connect(sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateDPI))));
154159
155 // The order is important here, DPI is the last thing to be updated160 // The order is important here, DPI is the last thing to be updated
161 UpdateCursorBlinkSpeed();
156 UpdateLimSetting();162 UpdateLimSetting();
157 UpdateTextScaleFactor();163 UpdateTextScaleFactor();
158 UpdateCursorScaleFactor();164 UpdateCursorScaleFactor();
@@ -195,6 +201,11 @@
195 cached_double_click_activate_ = g_settings_get_boolean(usettings_, DOUBLE_CLICK_ACTIVATE.c_str());201 cached_double_click_activate_ = g_settings_get_boolean(usettings_, DOUBLE_CLICK_ACTIVATE.c_str());
196 }202 }
197203
204 void UpdateCursorBlinkSpeed()
205 {
206 parent_->cursor_blink_speed = g_settings_get_int(gnome_ui_settings_, GNOME_CURSOR_BLINK.c_str());
207 }
208
198 void UpdateLimSetting()209 void UpdateLimSetting()
199 {210 {
200 parent_->lim_movement_thresold = g_settings_get_uint(lim_settings_, CLICK_MOVEMENT_THRESHOLD.c_str());211 parent_->lim_movement_thresold = g_settings_get_uint(lim_settings_, CLICK_MOVEMENT_THRESHOLD.c_str());
201212
=== modified file 'unity-shared/UnitySettings.h'
--- unity-shared/UnitySettings.h 2015-05-22 13:20:22 +0000
+++ unity-shared/UnitySettings.h 2015-05-26 19:14:24 +0000
@@ -54,6 +54,7 @@
54 nux::ROProperty<bool> double_click_activate;54 nux::ROProperty<bool> double_click_activate;
55 nux::Property<unsigned> lim_movement_thresold;55 nux::Property<unsigned> lim_movement_thresold;
56 nux::Property<unsigned> lim_double_click_wait;56 nux::Property<unsigned> lim_double_click_wait;
57 nux::Property<int> cursor_blink_speed;
57 nux::Property<bool> lim_unfocused_popup;58 nux::Property<bool> lim_unfocused_popup;
58 nux::Property<double> font_scaling;59 nux::Property<double> font_scaling;
59 nux::ROProperty<bool> remote_content;60 nux::ROProperty<bool> remote_content;