MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000641Deviation(No Category)public2015-10-11 01:462016-02-04 19:20
Reporterrichardclli 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Summary0000641: Font in Button Monitor Screen not following config.ini settings
DescriptionWhen I play around Lydros's Red Black Devo12 theme in current nighty, I found that the text is not display correctly in the Button Monitor page, this is due to the changes of the LabelDesc structure and forgot to change the code here for the right align LabelDesc definition.

Normally all the properties should be copied from DEFAULT_FONT except the alignment.

Here is the fix that I have done to solve the problem. This fix is quite obvious, but I think it will be even better to move all font definitions to a central place.

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -150,7 +150,7 @@
OFFSET_Y = ((LCD_HEIGHT - 240) / 2),
};
enum {X = 0, Y = 1};
- struct LabelDesc alignRight = { DEFAULT_FONT.font, 0, 0, DEFAULT_FONT.font_color, LABEL_RIGHT };
+ struct LabelDesc alignRight = { DEFAULT_FONT.font, LABEL_RIGHT, DEFAULT_FONT.font_color, DEFAULT_FONT.fill_color, DEFAULT_FONT.outline_color };
const int label_pos[NUM_TX_BUTTONS][2] = CHANTEST_BUTTON_PLACEMENT;
cp->is_locked = 3;
GUI_CreateLabelBox(&gui->lock, OFFSET_X, 34, 320, 20, &NARROW_FONT, lockstr_cb, NULL, NULL);
TagsNo tags attached.
Deviation Version
PlatformAny
Attached Files

- Relationships

-  Notes
(0001500)
richardclli (reporter)
2015-10-11 10:37

Applied a better coding style:

src/pages/320/240x16/chantest_page.c

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -150,7 +150,14 @@
         OFFSET_Y = ((LCD_HEIGHT - 240) / 2),
     };
     enum {X = 0, Y = 1};
- struct LabelDesc alignRight = { DEFAULT_FONT.font, 0, 0, DEFAULT_FONT.font_color, LABEL_RIGHT };
+ struct LabelDesc alignRight = {
+ .font = DEFAULT_FONT.font,
+ .style = LABEL_RIGHT,
+ .font_color = DEFAULT_FONT.font_color,
+ .fill_color = DEFAULT_FONT.fill_color,
+ .outline_color = DEFAULT_FONT.outline_color
+ };
+
     const int label_pos[NUM_TX_BUTTONS][2] = CHANTEST_BUTTON_PLACEMENT;
     cp->is_locked = 3;
     GUI_CreateLabelBox(&gui->lock, OFFSET_X, 34, 320, 20, &NARROW_FONT, lockstr_cb, NULL, NULL);
(0001501)
richardclli (reporter)
2015-10-11 10:38

Found another similar problem in src/pages/320x240x16/toggle_select.c

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -104,7 +104,14 @@
     u8 toggleinput = MIXER_SRC(Model.pagecfg2.elem[tp->tglidx].src);
 
     // style the switch textbox
- struct LabelDesc outline = { DEFAULT_FONT.font, 0, 0, DEFAULT_FONT.font_color, LABEL_TRANSPARENT };
+ struct LabelDesc outline = {
+ .font = DEFAULT_FONT.font,
+ .style = LABEL_TRANSPARENT,
+ .font_color = DEFAULT_FONT.font_color,
+ .fill_color = DEFAULT_FONT.fill_color,
+ .outline_color = DEFAULT_FONT.outline_color
+ };
+
     GUI_CreateRect(&gui->toggleframe, 80+80*SelectedIcon, 39, 77, 33, &outline);
 
     GUI_CreateLabelBox(&gui->switchbox, 4, 47, 70, 22, &NORMALBOX_FONT, NULL, NULL,
(0001523)
richardclli (reporter)
2016-02-04 19:20

This issue already fixed in current nightly build

- Issue History
Date Modified Username Field Change
2015-10-11 01:46 richardclli New Issue
2015-10-11 10:37 richardclli Note Added: 0001500
2015-10-11 10:38 richardclli Note Added: 0001501
2016-02-04 19:20 richardclli Note Added: 0001523


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker