Skip to content

Commit

Permalink
ui/gtk3: Get PangoAttrList of auxiliary text from IBusText
Browse files Browse the repository at this point in the history
Since IBus auxiliary text would be one line, it's better to show the
character attributes likes color, italic, bold, on the auxiliary text.

Also deleted the cursor width from the X position of CandidatePanel
because IBus preedit overrides the original cursor of the applications.
  • Loading branch information
fujiwarat committed Jun 4, 2018
1 parent 8ab0b60 commit a1f91b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/gtk3/candidatepanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ibus - The Input Bus
*
* Copyright(c) 2011-2015 Peng Huang <[email protected]>
* Copyright(c) 2015-2017 Takao Fujiwara <[email protected]>
* Copyright(c) 2015-2018 Takao Fujiwara <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -153,6 +153,8 @@ public class CandidatePanel : Gtk.Box{
public void set_auxiliary_text(IBus.Text? text) {
if (text != null) {
m_aux_label.set_text(text.get_text());
Pango.AttrList attrs = get_pango_attr_list_from_ibus_text(text);
m_aux_label.set_attributes(attrs);
m_aux_label.show();
} else {
m_aux_label.set_text("");
Expand Down Expand Up @@ -314,7 +316,7 @@ public class CandidatePanel : Gtk.Box{

private void adjust_window_position_horizontal() {
Gdk.Point cursor_right_bottom = {
m_cursor_location.x + m_cursor_location.width,
m_cursor_location.x,
m_cursor_location.y + m_cursor_location.height
};

Expand Down

0 comments on commit a1f91b2

Please sign in to comment.