Opened 9 years ago

Last modified 9 years ago

#4792 new defect

Journal: device palette position is wrong

Reported by: godiard Owned by:
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords: F20
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Screenshot attached

Attachments (1)

device_palette_with_wrong_position.png (35.8 KB) - added by godiard 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by godiard

comment:1 Changed 9 years ago by godiard

  • Keywords F20 added

comment:2 Changed 9 years ago by SAMdroid

This seems to be a bug with the estimation of the palette size. The secondary text should be up to 3 lines but it only ever shows as 1.

I have isolated the code to the GTK 3.10+ branch of sugar3.graphics.palette.Palette.set_secondary_text. This stops the issue from occurring:

diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py
index 5a0bfea..0804745 100644
--- a/src/sugar3/graphics/palette.py
+++ b/src/sugar3/graphics/palette.py
@@ -291,7 +291,7 @@ class Palette(PaletteWindow):
             label = label.replace('\n', ' ')
             label = label.replace('\r', ' ')
 
-            if hasattr(self._secondary_label, 'set_lines'):
+            if hasattr(self._secondary_label, 'set_lines') and False:
                 self._secondary_label.set_max_width_chars(
                     style.MENU_WIDTH_CHARS)
                 self._secondary_label.set_line_wrap(True)

comment:3 Changed 9 years ago by SAMdroid

Also, commenting out the set_line_wrap or set_lines function call removes the problem. (Those are the only ones - tried all calls in the offending code branch).

This is very odd.

comment:4 Changed 9 years ago by godiard

I have found possible solution (and explanation) to this issue https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/247

Note: See TracTickets for help on using tickets.