mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-22 18:26:39 +00:00
Smooth ticker for single line labels.
This commit is contained in:
parent
b46740de8a
commit
4cd7a9c782
3 changed files with 28 additions and 35 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 803670dc42611af6deba5355d2069a944234cbb5
|
Subproject commit 284d7b68e9ba4e887c13dde562f9eb35b2961d52
|
|
@ -50,27 +50,34 @@ namespace nxdt::views
|
||||||
this->applet_mode_lbl->setParent(this);
|
this->applet_mode_lbl->setParent(this);
|
||||||
|
|
||||||
this->time_lbl = new brls::Label(brls::LabelStyle::SMALL, "");
|
this->time_lbl = new brls::Label(brls::LabelStyle::SMALL, "");
|
||||||
|
this->time_lbl->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->time_lbl->setParent(this);
|
this->time_lbl->setParent(this);
|
||||||
|
|
||||||
this->battery_icon = new brls::Label(brls::LabelStyle::SMALL, "");
|
this->battery_icon = new brls::Label(brls::LabelStyle::SMALL, "");
|
||||||
this->battery_icon->setFont(material);
|
this->battery_icon->setFont(material);
|
||||||
|
this->battery_icon->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->battery_icon->setParent(this);
|
this->battery_icon->setParent(this);
|
||||||
|
|
||||||
this->battery_percentage = new brls::Label(brls::LabelStyle::SMALL, "");
|
this->battery_percentage = new brls::Label(brls::LabelStyle::SMALL, "");
|
||||||
|
this->battery_percentage->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->battery_percentage->setParent(this);
|
this->battery_percentage->setParent(this);
|
||||||
|
|
||||||
this->connection_icon = new brls::Label(brls::LabelStyle::SMALL, "");
|
this->connection_icon = new brls::Label(brls::LabelStyle::SMALL, "");
|
||||||
this->connection_icon->setFont(material);
|
this->connection_icon->setFont(material);
|
||||||
|
this->connection_icon->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->connection_icon->setParent(this);
|
this->connection_icon->setParent(this);
|
||||||
|
|
||||||
this->connection_status_lbl = new brls::Label(brls::LabelStyle::SMALL, "");
|
this->connection_status_lbl = new brls::Label(brls::LabelStyle::SMALL, "");
|
||||||
|
this->connection_status_lbl->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->connection_status_lbl->setParent(this);
|
this->connection_status_lbl->setParent(this);
|
||||||
|
|
||||||
this->usb_icon = new brls::Label(brls::LabelStyle::SMALL, "\uE1E0");
|
this->usb_icon = new brls::Label(brls::LabelStyle::SMALL, "\uE1E0");
|
||||||
this->usb_icon->setFont(material);
|
this->usb_icon->setFont(material);
|
||||||
|
this->usb_icon->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->usb_icon->setParent(this);
|
this->usb_icon->setParent(this);
|
||||||
|
|
||||||
this->usb_host_speed_lbl = new brls::Label(brls::LabelStyle::SMALL, "root_view/not_connected"_i18n);
|
this->usb_host_speed_lbl = new brls::Label(brls::LabelStyle::SMALL, "root_view/not_connected"_i18n);
|
||||||
|
this->usb_host_speed_lbl->setVerticalAlign(NVG_ALIGN_TOP);
|
||||||
this->usb_host_speed_lbl->setParent(this);
|
this->usb_host_speed_lbl->setParent(this);
|
||||||
|
|
||||||
/* Start background tasks. */
|
/* Start background tasks. */
|
||||||
|
@ -211,54 +218,40 @@ namespace nxdt::views
|
||||||
if (this->applet_mode)
|
if (this->applet_mode)
|
||||||
{
|
{
|
||||||
/* Applet mode label. */
|
/* Applet mode label. */
|
||||||
this->applet_mode_lbl->invalidate(true);
|
x_pos = (this->x + (this->width - this->applet_mode_lbl->getTextWidth()) / 2);
|
||||||
|
|
||||||
x_pos = (this->x + (this->width - this->applet_mode_lbl->getWidth()) / 2);
|
|
||||||
y_pos = (this->y + (style->AppletFrame.headerHeightRegular / 2) + style->AppletFrame.titleOffset);
|
y_pos = (this->y + (style->AppletFrame.headerHeightRegular / 2) + style->AppletFrame.titleOffset);
|
||||||
|
|
||||||
this->applet_mode_lbl->setBoundaries(x_pos, y_pos, this->applet_mode_lbl->getWidth(), this->applet_mode_lbl->getHeight());
|
this->applet_mode_lbl->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
y_pos = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Time label. */
|
/* Time label. */
|
||||||
this->time_lbl->invalidate(true);
|
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->time_lbl->getTextWidth());
|
||||||
|
y_pos = this->y + style->AppletFrame.imageTopPadding;
|
||||||
|
|
||||||
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->time_lbl->getWidth());
|
this->time_lbl->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
y_pos += this->y + 25 + this->time_lbl->getHeight();
|
|
||||||
|
|
||||||
this->time_lbl->setBoundaries(x_pos, y_pos, this->time_lbl->getWidth(), this->time_lbl->getHeight());
|
|
||||||
|
|
||||||
/* Battery stats and network connection labels. */
|
/* Battery stats and network connection labels. */
|
||||||
this->battery_icon->invalidate(true);
|
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->connection_status_lbl->getTextWidth());
|
||||||
this->battery_percentage->invalidate(true);
|
y_pos += (this->time_lbl->getTextHeight() + 5);
|
||||||
|
|
||||||
this->connection_icon->invalidate(true);
|
this->connection_status_lbl->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
this->connection_status_lbl->invalidate(true);
|
x_pos -= (5 + this->connection_icon->getTextWidth());
|
||||||
|
|
||||||
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->connection_status_lbl->getWidth());
|
this->connection_icon->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
y_pos += (20 + this->connection_icon->getHeight());
|
x_pos -= (10 + this->battery_percentage->getTextWidth());
|
||||||
|
|
||||||
this->connection_status_lbl->setBoundaries(x_pos, y_pos, this->connection_status_lbl->getWidth(), this->connection_status_lbl->getHeight());
|
this->battery_percentage->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
x_pos -= (5 + this->connection_icon->getWidth());
|
x_pos -= (5 + this->battery_icon->getTextWidth());
|
||||||
|
|
||||||
this->connection_icon->setBoundaries(x_pos, y_pos, this->connection_icon->getWidth(), this->connection_icon->getHeight());
|
this->battery_icon->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
x_pos -= (10 + this->battery_percentage->getWidth());
|
|
||||||
|
|
||||||
this->battery_percentage->setBoundaries(x_pos, y_pos, this->battery_percentage->getWidth(), this->battery_percentage->getHeight());
|
|
||||||
x_pos -= (5 + this->battery_icon->getWidth());
|
|
||||||
|
|
||||||
this->battery_icon->setBoundaries(x_pos, y_pos, this->battery_icon->getWidth(), this->battery_icon->getHeight());
|
|
||||||
|
|
||||||
/* USB host speed labels. */
|
/* USB host speed labels. */
|
||||||
this->usb_icon->invalidate(true);
|
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->usb_host_speed_lbl->getTextWidth());
|
||||||
this->usb_host_speed_lbl->invalidate(true);
|
y_pos += (this->connection_status_lbl->getTextHeight() + 5);
|
||||||
|
|
||||||
x_pos = (this->x + this->width - (style->AppletFrame.separatorSpacing * 2) - this->usb_host_speed_lbl->getWidth());
|
this->usb_host_speed_lbl->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
y_pos += (20 + this->usb_icon->getHeight());
|
x_pos -= (5 + this->usb_icon->getTextWidth());
|
||||||
|
|
||||||
this->usb_host_speed_lbl->setBoundaries(x_pos, y_pos, this->usb_host_speed_lbl->getWidth(), this->usb_host_speed_lbl->getHeight());
|
this->usb_icon->setBoundaries(x_pos, y_pos, 0, 0);
|
||||||
x_pos -= (5 + this->usb_icon->getWidth());
|
|
||||||
|
|
||||||
this->usb_icon->setBoundaries(x_pos, y_pos, this->battery_icon->getWidth(), this->battery_icon->getHeight());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace nxdt::views
|
||||||
/* Set sublabel. */
|
/* Set sublabel. */
|
||||||
if (!this->is_system)
|
if (!this->is_system)
|
||||||
{
|
{
|
||||||
this->subLabel = std::string(app_metadata->lang_entry.author);
|
this->setSubLabel(std::string(app_metadata->lang_entry.author));
|
||||||
this->setHeight(brls::Application::getStyle()->List.Item.heightWithSubLabel);
|
this->setHeight(brls::Application::getStyle()->List.Item.heightWithSubLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue