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
1=== modified file 'unity-shared/SearchBar.cpp'
2--- unity-shared/SearchBar.cpp 2015-04-24 12:58:20 +0000
3+++ unity-shared/SearchBar.cpp 2015-05-26 19:14:24 +0000
4@@ -271,6 +271,7 @@
5 showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));
6 scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale));
7 Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize)));
8+ Settings::Instance().cursor_blink_speed.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateBlinkSpeed)));
9 can_refine_search.changed.connect([this] (bool can_refine)
10 {
11 if (show_filter_hint_)
12@@ -343,6 +344,12 @@
13 SetMaximumHeight(search_bar_height);
14 }
15
16+void SearchBar::UpdateBlinkSpeed()
17+{
18+ unsigned blink_speed = Settings::Instance().cursor_blink_speed();
19+ pango_entry_->SetCursorBlinkSpeed(blink_speed);
20+}
21+
22 void SearchBar::UpdateScale(double scale)
23 {
24 hint_->SetMinimumSize(nux::AREA_MIN_WIDTH, nux::AREA_MIN_HEIGHT);
25
26=== modified file 'unity-shared/SearchBar.h'
27--- unity-shared/SearchBar.h 2015-04-24 12:58:20 +0000
28+++ unity-shared/SearchBar.h 2015-05-26 19:14:24 +0000
29@@ -98,6 +98,7 @@
30
31 bool ShouldBeHighlighted();
32 void UpdateSearchBarSize();
33+ void UpdateBlinkSpeed();
34 void UpdateScale(double scale);
35
36 std::unique_ptr<nux::AbstractPaintLayer> bg_layer_;
37
38=== modified file 'unity-shared/UnitySettings.cpp'
39--- unity-shared/UnitySettings.cpp 2015-05-22 13:20:22 +0000
40+++ unity-shared/UnitySettings.cpp 2015-05-26 19:14:24 +0000
41@@ -53,9 +53,10 @@
42 const std::string UBUNTU_UI_SETTINGS = "com.ubuntu.user-interface";
43 const std::string SCALE_FACTOR = "scale-factor";
44
45-const std::string GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
46-const std::string GNOME_FONT_NAME = "font-name";
47-const std::string GNOME_CURSOR_SIZE = "cursor-size";
48+const std::string GNOME_UI_SETTINGS = "org.gnome.desktop.interface";
49+const std::string GNOME_FONT_NAME = "font-name";
50+const std::string GNOME_CURSOR_SIZE = "cursor-size";
51+const std::string GNOME_CURSOR_BLINK = "cursor-blink-time";
52 const std::string GNOME_SCALE_FACTOR = "scaling-factor";
53 const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor";
54
55@@ -142,6 +143,10 @@
56 }
57 });
58
59+ signals_.Add<void, GSettings*, const gchar*>(gnome_ui_settings_, "changed::" + GNOME_CURSOR_BLINK, [this] (GSettings*, const gchar* t) {
60+ UpdateCursorBlinkSpeed();
61+ });
62+
63 signals_.Add<void, GSettings*, const gchar*>(lim_settings_, "changed", [this] (GSettings*, const gchar*) {
64 UpdateLimSetting();
65 });
66@@ -153,6 +158,7 @@
67 UScreen::GetDefault()->changed.connect(sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateDPI))));
68
69 // The order is important here, DPI is the last thing to be updated
70+ UpdateCursorBlinkSpeed();
71 UpdateLimSetting();
72 UpdateTextScaleFactor();
73 UpdateCursorScaleFactor();
74@@ -195,6 +201,11 @@
75 cached_double_click_activate_ = g_settings_get_boolean(usettings_, DOUBLE_CLICK_ACTIVATE.c_str());
76 }
77
78+ void UpdateCursorBlinkSpeed()
79+ {
80+ parent_->cursor_blink_speed = g_settings_get_int(gnome_ui_settings_, GNOME_CURSOR_BLINK.c_str());
81+ }
82+
83 void UpdateLimSetting()
84 {
85 parent_->lim_movement_thresold = g_settings_get_uint(lim_settings_, CLICK_MOVEMENT_THRESHOLD.c_str());
86
87=== modified file 'unity-shared/UnitySettings.h'
88--- unity-shared/UnitySettings.h 2015-05-22 13:20:22 +0000
89+++ unity-shared/UnitySettings.h 2015-05-26 19:14:24 +0000
90@@ -54,6 +54,7 @@
91 nux::ROProperty<bool> double_click_activate;
92 nux::Property<unsigned> lim_movement_thresold;
93 nux::Property<unsigned> lim_double_click_wait;
94+ nux::Property<int> cursor_blink_speed;
95 nux::Property<bool> lim_unfocused_popup;
96 nux::Property<double> font_scaling;
97 nux::ROProperty<bool> remote_content;