From bf852064bcef5cbce388ba0ea78fbbe8a619a07f Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 16 May 2017 10:31:25 +0200 Subject: [PATCH 1/8] - buttons: use OFFSET defines --- src/gui/widget/buttons.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index e0095b45e..9c5a7995e 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -103,8 +103,8 @@ int paintButtons( const button_label_ext * const content, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; @@ -312,8 +312,8 @@ int paintButtons( const int &x, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; From b7ef6e47fe0e9b909988b75a73636c55f104b94b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 17 May 2017 17:23:22 +0200 Subject: [PATCH 2/8] - cables.xml: update Antennengemeinschaft "Goeltzschtalbruecke" --- data/cables.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/cables.xml b/data/cables.xml index e05516a44..fa4baec60 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -534,7 +534,7 @@ - + From e48cc87b6fa93c38783cfc791c8bff94fd6ecd8c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 17 May 2017 20:08:50 +0200 Subject: [PATCH 3/8] CHintBox: fix position in case of missing text Without text, position was not complete calculated. Only default position was used. --- src/gui/widget/hintbox.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 45ef2b6ed..47d0e474c 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -162,6 +162,8 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string if (!Text.empty()) addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font); + else + ReSize(); } CHintBox::~CHintBox() @@ -312,13 +314,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const info_box->setPicture(Picon); info_box->doPaintBg(false); - /* recalculate new hintbox height */ + /* recalculate new hintbox dimensions and position*/ ReSize(); - - /* set hint box position general to center and refresh window */ - setCenterPos(CC_ALONG_X); - y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), - Refresh(); } void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style) @@ -350,6 +347,10 @@ void CHintBox::ReSize() h += item->getHeight(); } height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h))); + + /* set hint box position general to center and refresh window */ + setCenterPos(CC_ALONG_X); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), Refresh(); } From ffe986f36ba3bee015f22cbb46c9628253ffb44f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 17 May 2017 22:15:15 +0200 Subject: [PATCH 4/8] src/gui/lua/lua_cc_text.cpp avoid segfault --- src/gui/lua/lua_cc_text.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 461164e1a..2cbaa45d3 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -208,10 +208,11 @@ int CLuaInstCCText::CCTextSetText(lua_State *L) std::string text = ""; lua_Integer mode = D->mode; lua_Integer font_text = D->font_text; - tableLookup(L, "text", text); - tableLookup(L, "mode", mode); - tableLookup(L, "font_text", font_text); - + if (lua_istable(L, -1)){ + tableLookup(L, "text", text); + tableLookup(L, "mode", mode); + tableLookup(L, "font_text", font_text); + } D->ct->setText(text, mode, g_Font[font_text]); return 0; } From 8c29b8e68f3886ead091d1a4f7e50dd99d727ff4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 5/8] CHintBox: use less colors time scale mode for visual timeout Otherwise probably in this context to much colored with default settings. --- src/gui/widget/hintbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 47d0e474c..e0eec64f8 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -188,6 +188,7 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb->setValues(timeout_pb->getValue()+1, 100*timeout); }else{ timeout_pb = new CProgressBar(); + timeout_pb->setType(CProgressBar::PB_TIMESCALE); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, 100*timeout); if (!timeout_pb_timer) { From 37387a3e690dd6684c9713a30325626a88cc8d48 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 6/8] CMsgBox: fix paint of footer buttons Only paint of button container is required. --- src/gui/widget/msgbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index eb40539cb..c1cdbfe30 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -335,7 +335,7 @@ int CMsgBox::exec() void CMsgBox::refreshFoot(void) { - ccw_footer->paint(false); + ccw_footer->getButtonChainObject()->paint(); } From 9132e7de8262e4930c8b18b8890d04016525ae4c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 7/8] cc_item.h/cc_frm.h/cc_frm_button.h: use pre defined frame color as default --- src/gui/components/cc_frm.h | 4 ++-- src/gui/components/cc_frm_button.h | 24 ++++++++++++------------ src/gui/components/cc_item.h | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 59f488fdb..f1aba0a9c 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -157,7 +157,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as size_t virtual void setSelectedItem( int item_id, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, @@ -165,7 +165,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as CComponentsItem* virtual void setSelectedItem( CComponentsItem* cc_item, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 1e36bd826..c85777ff7 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;}; @@ -246,7 +246,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -257,7 +257,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -277,7 +277,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -289,7 +289,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -309,7 +309,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -320,7 +320,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -340,7 +340,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; @@ -351,7 +351,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 37677a813..9d633ad62 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -110,7 +110,7 @@ class CComponentsItem : public CComponents ///set select mode virtual void setSelected(bool selected, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, From 36c8f4c24f45d2c97b48f8bccb3f2b923333792a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 21 May 2017 18:00:21 +0200 Subject: [PATCH 8/8] CComponentsButton: add missing init of col_body_old Some changes on runtime were ignored on runtime. --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index b7e964356..c7215b4fc 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -106,7 +106,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); col_frame = color_frame; - col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body; + col_body = col_body_old = cc_body_gradient_enable? COL_DARK_GRAY : color_body; col_shadow = color_shadow; cc_item_enabled = enabled;