Nux

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

Proposed by Brandon Schaefer on 2015-05-05
Status: Needs review
Proposed branch: lp:~brandontschaefer/nux/lp.834465-fix-ABI-BREAK
Merge into: lp:nux
Diff against target: 62 lines (+19/-1)
2 files modified
Nux/TextEntry.cpp (+14/-1)
Nux/TextEntry.h (+5/-0)
To merge this branch: bzr merge lp:~brandontschaefer/nux/lp.834465-fix-ABI-BREAK
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing on 2015-05-26
Stephen M. Webb (community) 2015-05-05 Needs Fixing on 2015-05-26
Review via email: mp+258321@code.launchpad.net

Commit message

Allow setting the cursor blink speed

Description of the change

Allow setting the cursor blink speed

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good, and one minor thing if you want.
Also check this comment https://code.launchpad.net/~brandontschaefer/unity/lp.834465-fix-ABI-BREAK-FIX/+merge/258323/comments/645079 in order to adapt the API to support no-blinking.

By the way I'd like to follow this ABI break branch with another change for having consistent double clicks settings as well (so we can just break things once).

Stephen M. Webb (bregma) wrote :

Could you please break the ABI bump into a separate MP so we can batch multiple ABI-breaking changes together (but still be able to back one out if necessary)?

review: Needs Fixing
860. By Brandon Schaefer on 2015-05-26

* Remove the ABI bump, THIS BRANCH STILL BREAKS ABI. Just need to bump the ABI
  in a different branch

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

860. By Brandon Schaefer on 2015-05-26

* Remove the ABI bump, THIS BRANCH STILL BREAKS ABI. Just need to bump the ABI
  in a different branch

859. By Brandon Schaefer on 2015-05-05

* Allows setting the cursor blink speed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/TextEntry.cpp'
2--- Nux/TextEntry.cpp 2014-03-05 03:42:22 +0000
3+++ Nux/TextEntry.cpp 2015-05-26 19:19:24 +0000
4@@ -145,6 +145,7 @@
5 , scroll_offset_y_(0)
6 , cursor_blink_timer_(0)
7 , cursor_blink_status_(0)
8+ , cursor_blink_speed_(kCursorBlinkTimeout)
9 , visible_(true)
10 , focused_(false)
11 , need_im_reset_(false)
12@@ -1156,7 +1157,7 @@
13 return;
14
15 if (!cursor_blink_timer_)
16- cursor_blink_timer_ = g_timeout_add(kCursorBlinkTimeout,
17+ cursor_blink_timer_ = g_timeout_add(cursor_blink_speed_,
18 (GSourceFunc)&CursorBlinkCallback,
19 this);
20 }
21@@ -2386,6 +2387,18 @@
22 QueueRefresh(true, true);
23 }
24
25+ void TextEntry::SetCursorBlinkSpeed(int blink_speed)
26+ {
27+ if (cursor_blink_timer_)
28+ {
29+ g_source_remove(cursor_blink_timer_);
30+ cursor_blink_timer_ = 0;
31+ }
32+
33+ cursor_blink_speed_ = blink_speed;
34+ QueueCursorBlink();
35+ }
36+
37 bool TextEntry::InspectKeyEvent(unsigned int /* eventType */, unsigned int /* key_sym */, const char* /* character */)
38 {
39 nux::Event const& cur_event = GetGraphicsDisplay()->GetCurrentEvent();
40
41=== modified file 'Nux/TextEntry.h'
42--- Nux/TextEntry.h 2014-03-05 03:42:22 +0000
43+++ Nux/TextEntry.h 2015-05-26 19:19:24 +0000
44@@ -159,6 +159,8 @@
45 void SetFontSize(double font_size);
46 void SetFontOptions(const cairo_font_options_t* options);
47
48+ void SetCursorBlinkSpeed(int blink_speed);
49+
50 /** Select text between start and end. */
51 void Select(int start, int end);
52 /** Select all text */
53@@ -434,6 +436,9 @@
54 */
55 int cursor_blink_status_;
56
57+ /** The blink speed of the cursor **/
58+ int cursor_blink_speed_;
59+
60 /*! Whether the text is visible, or its characters are masked by a default char (password mode). */
61 bool visible_;
62 /** Whether the edit control is focused */

Subscribers

People subscribed via source and target branches