Merge branch 'v5' of github.com:noctalia-dev/noctalia-shell into v5

This commit is contained in:
Lemmy
2026-05-07 09:02:12 -04:00
3 changed files with 12 additions and 5 deletions
+1
View File
@@ -693,6 +693,7 @@
"inspector": {
"edit-title": "Editing widget",
"add-title": "Add widget to {lane}",
"add-instance-title": "Add {widget} widget to {lane}",
"move-to-lane": "Move to {lane}"
},
"detail": {
+3
View File
@@ -146,6 +146,9 @@ void ClockWidget::doLayout(Renderer& renderer, float containerWidth, float conta
renderer.measureText(m_lastPrimaryText, primaryFontSize, true, 0.0f, 1, TextAlign::Start);
const auto secondaryMetrics =
renderer.measureText(m_lastSecondaryText, secondaryFontSize, false, 0.0f, 1, TextAlign::Start);
const float primaryInkWidth = std::max(0.0f, primaryMetrics.inkRight - primaryMetrics.inkLeft);
const float secondaryInkWidth = std::max(0.0f, secondaryMetrics.inkRight - secondaryMetrics.inkLeft);
width = std::max({width, primaryInkWidth, secondaryInkWidth});
const float centerX = width * 0.5f;
const float primaryInkCenterX = (primaryMetrics.inkLeft + primaryMetrics.inkRight) * 0.5f;
const float secondaryInkCenterX = (secondaryMetrics.inkLeft + secondaryMetrics.inkRight) * 0.5f;
+8 -5
View File
@@ -388,9 +388,12 @@ namespace settings {
header->setGap(Style::spaceSm * m_scale);
m_headerRow = header.get();
header->addChild(makeLabel(i18n::tr("settings.entities.widget.inspector.add-title", "lane",
laneLabel(m_lanePath.empty() ? "" : m_lanePath.back())),
Style::fontSizeBody * m_scale, colorSpecFromRole(ColorRole::OnSurface), true));
const std::string lane = laneLabel(m_lanePath.empty() ? "" : m_lanePath.back());
const std::string title =
m_createFormVisible
? i18n::tr("settings.entities.widget.inspector.add-instance-title", "widget", m_createLabel, "lane", lane)
: i18n::tr("settings.entities.widget.inspector.add-title", "lane", lane);
header->addChild(makeLabel(title, Style::fontSizeBody * m_scale, colorSpecFromRole(ColorRole::OnSurface), true));
auto spacer = std::make_unique<Flex>();
spacer->setFlexGrow(1.0f);
@@ -420,12 +423,12 @@ namespace settings {
auto closeBtn = std::make_unique<Button>();
closeBtn->setGlyph("close");
closeBtn->setVariant(ButtonVariant::Ghost);
closeBtn->setVariant(ButtonVariant::Default);
closeBtn->setGlyphSize(Style::fontSizeBody * m_scale);
closeBtn->setMinWidth(Style::controlHeightSm * m_scale);
closeBtn->setMinHeight(Style::controlHeightSm * m_scale);
closeBtn->setPadding(Style::spaceXs * m_scale);
closeBtn->setRadius(Style::radiusSm * m_scale);
closeBtn->setRadius(Style::radiusMd * m_scale);
closeBtn->setOnClick([this]() { DeferredCall::callLater([this]() { close(); }); });
header->addChild(std::move(closeBtn));
root->addChild(std::move(header));