UI: header icon + title; always show OC controls; About Logo cleanup
- Use gui_icon.png next to APP_TITLE in the applet header (replaces text-only header Logo). - Simplify Logo to About tab only; drop unused HEADER style. - Show frequency/voltage/toggle controls even when INI keys are absent (defaults until edited). - Add resources/gui_icon.png to RomFS. Made-with: Cursor
This commit is contained in:
35
src/logo.cpp
35
src/logo.cpp
@@ -5,9 +5,9 @@
|
||||
|
||||
#include "logo.h"
|
||||
|
||||
Logo::Logo(LogoStyle style)
|
||||
Logo::Logo()
|
||||
{
|
||||
this->logoLabel = new brls::Label(brls::LabelStyle::LIST_ITEM, "SWR", style == LogoStyle::ABOUT);
|
||||
this->logoLabel = new brls::Label(brls::LabelStyle::LIST_ITEM, "SWR", true);
|
||||
this->logoLabel->setParent(this);
|
||||
|
||||
int logoFont = brls::Application::findFont(LOGO_FONT_NAME);
|
||||
@@ -16,35 +16,18 @@ Logo::Logo(LogoStyle style)
|
||||
this->logoLabel->setFont(logoFont);
|
||||
}
|
||||
|
||||
if (style == LogoStyle::ABOUT)
|
||||
{
|
||||
this->logoLabel->setFontSize(LOGO_ABOUT_FONT_SIZE);
|
||||
this->logoLabel->setHorizontalAlign(NVG_ALIGN_CENTER);
|
||||
}
|
||||
|
||||
if (style == LogoStyle::HEADER)
|
||||
{
|
||||
this->logoLabel->setFontSize(LOGO_HEADER_FONT_SIZE);
|
||||
this->descLabel = new brls::Label(brls::LabelStyle::LIST_ITEM, "INI Tool");
|
||||
this->descLabel->setParent(this);
|
||||
this->descLabel->setFontSize(LOGO_DESC_FONT_SIZE);
|
||||
}
|
||||
this->logoLabel->setFontSize(LOGO_ABOUT_FONT_SIZE);
|
||||
this->logoLabel->setHorizontalAlign(NVG_ALIGN_CENTER);
|
||||
}
|
||||
|
||||
Logo::~Logo()
|
||||
{
|
||||
delete this->logoLabel;
|
||||
|
||||
if (this->descLabel)
|
||||
delete this->descLabel;
|
||||
}
|
||||
|
||||
void Logo::draw(NVGcontext* vg, int x, int y, unsigned width, unsigned height, brls::Style* style, brls::FrameContext* ctx)
|
||||
{
|
||||
this->logoLabel->frame(ctx);
|
||||
|
||||
if (this->descLabel)
|
||||
this->descLabel->frame(ctx);
|
||||
}
|
||||
|
||||
void Logo::layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash)
|
||||
@@ -52,14 +35,4 @@ void Logo::layout(NVGcontext* vg, brls::Style* style, brls::FontStash* stash)
|
||||
this->logoLabel->setBoundaries(this->x, this->y + LOGO_OFFSET, this->width, this->height);
|
||||
this->logoLabel->layout(vg, style, stash);
|
||||
this->height = this->logoLabel->getHeight();
|
||||
|
||||
if (this->descLabel)
|
||||
{
|
||||
this->descLabel->layout(vg, style, stash);
|
||||
this->descLabel->setBoundaries(
|
||||
this->x + LOGO_HEADER_SPACING + this->logoLabel->getWidth(),
|
||||
this->y + style->AppletFrame.titleOffset - 1,
|
||||
this->descLabel->getWidth(),
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user