diff --git a/ui/effects/gradient.h b/ui/effects/gradient.h index f6988c5..1c882f0 100644 --- a/ui/effects/gradient.h +++ b/ui/effects/gradient.h @@ -41,8 +41,9 @@ namespace details { template class gradients { public: + gradients() = default; gradients(base::flat_map> colors) { - Expects(colors.size() > 0); + Expects(!colors.empty()); for (const auto &[key, value] : colors) { auto c = gradient_colors(std::move(value)); @@ -50,7 +51,7 @@ public: } } gradients(base::flat_map colors) { - Expects(colors.size() > 0); + Expects(!colors.empty()); for (const auto &[key, c] : colors) { _gradients.emplace(key, gradient_with_stops(std::move(c.stops))); @@ -58,6 +59,8 @@ public: } QGradient gradient(T state1, T state2, float64 b_ratio) const { + Expects(!_gradients.empty()); + if (b_ratio == 0.) { return _gradients.find(state1)->second; } else if (b_ratio == 1.) { @@ -163,6 +166,7 @@ class linear_gradients final using parent = details::gradients>; public: + linear_gradients() = default; linear_gradients( base::flat_map> colors, QPointF point1, @@ -205,6 +209,7 @@ class radial_gradients final using parent = details::gradients>; public: + radial_gradients() = default; radial_gradients( base::flat_map> colors, QPointF center, diff --git a/ui/integration.cpp b/ui/integration.cpp index 8bd1f71..ae25fc0 100644 --- a/ui/integration.cpp +++ b/ui/integration.cpp @@ -36,6 +36,10 @@ void Integration::textActionsUpdated() { void Integration::activationFromTopPanel() { } +bool Integration::screenIsLocked() { + return false; +} + QString Integration::timeFormat() { return u"hh:mm"_q; } diff --git a/ui/integration.h b/ui/integration.h index 94b09d3..c51f774 100644 --- a/ui/integration.h +++ b/ui/integration.h @@ -40,6 +40,7 @@ public: virtual void textActionsUpdated(); virtual void activationFromTopPanel(); + [[nodiscard]] virtual bool screenIsLocked(); [[nodiscard]] virtual QString timeFormat(); [[nodiscard]] virtual std::shared_ptr createLinkHandler( diff --git a/ui/paint/blob.cpp b/ui/paint/blob.cpp index 22ccf19..af9f830 100644 --- a/ui/paint/blob.cpp +++ b/ui/paint/blob.cpp @@ -86,12 +86,12 @@ void RadialBlob::paint(Painter &p, const QBrush &brush, float outerScale) { auto path = QPainterPath(); auto m = QMatrix(); - p.save(); const auto scale = (_minScale + (1. - _minScale) * _scale) * outerScale; if (scale == 0.) { - p.restore(); return; - } else if (scale != 1.) { + } + p.save(); + if (scale != 1.) { p.scale(scale, scale); } diff --git a/ui/ui_utility.cpp b/ui/ui_utility.cpp index 097cd74..10611d0 100644 --- a/ui/ui_utility.cpp +++ b/ui/ui_utility.cpp @@ -189,6 +189,8 @@ bool IsContentVisible( const auto activeOrNotOverlapped = [&] { if (const auto active = widget->isActiveWindow()) { return active; + } else if (Integration::Instance().screenIsLocked()) { + return false; } const auto mappedRect = QHighDpi::toNativePixels( diff --git a/ui/widgets/buttons.cpp b/ui/widgets/buttons.cpp index 206ec73..29f7a56 100644 --- a/ui/widgets/buttons.cpp +++ b/ui/widgets/buttons.cpp @@ -682,6 +682,8 @@ SettingsButton::SettingsButton( }, lifetime()); } +SettingsButton::~SettingsButton() = default; + SettingsButton *SettingsButton::toggleOn(rpl::producer &&toggled) { Expects(_toggle == nullptr); _toggle = std::make_unique( diff --git a/ui/widgets/buttons.h b/ui/widgets/buttons.h index 239f6a7..7e0b83d 100644 --- a/ui/widgets/buttons.h +++ b/ui/widgets/buttons.h @@ -254,6 +254,7 @@ public: QWidget *parent, rpl::producer &&text, const style::SettingsButton &st); + ~SettingsButton(); SettingsButton *toggleOn(rpl::producer &&toggled); bool toggled() const; diff --git a/ui/widgets/menu/menu_toggle.cpp b/ui/widgets/menu/menu_toggle.cpp index eedc7bc..bc0da8c 100644 --- a/ui/widgets/menu/menu_toggle.cpp +++ b/ui/widgets/menu/menu_toggle.cpp @@ -27,7 +27,6 @@ Toggle::Toggle( , _toggleShift(st.itemToggleShift) , _itemToggle(st.itemToggle) , _itemToggleOver(st.itemToggleOver) { - const auto processAction = [=] { if (!action()->isCheckable()) { _toggle.reset(); @@ -52,9 +51,10 @@ Toggle::Toggle( } _toggle->setStyle(data.selected ? _itemToggleOver : _itemToggle); }, lifetime()); - } +Toggle::~Toggle() = default; + void Toggle::paintEvent(QPaintEvent *e) { Action::paintEvent(e); if (_toggle) { diff --git a/ui/widgets/menu/menu_toggle.h b/ui/widgets/menu/menu_toggle.h index 7806858..f83ad86 100644 --- a/ui/widgets/menu/menu_toggle.h +++ b/ui/widgets/menu/menu_toggle.h @@ -24,6 +24,7 @@ public: Fn &&callback, const style::icon *icon, const style::icon *iconOver); + ~Toggle(); void finishAnimating() override; diff --git a/ui/widgets/widgets.style b/ui/widgets/widgets.style index e9a605e..81585b1 100644 --- a/ui/widgets/widgets.style +++ b/ui/widgets/widgets.style @@ -694,8 +694,8 @@ defaultScrollArea: ScrollArea { deltat: 3px; deltab: 3px; - topsh: 2px; - bottomsh: 2px; + topsh: 0px; + bottomsh: 0px; shColor: shadowFg; duration: 150; @@ -708,9 +708,6 @@ defaultSolidScroll: ScrollArea(defaultScrollArea) { deltat: 6px; deltab: 6px; - topsh: 0px; - bottomsh: 0px; - hiding: 0; } @@ -1424,55 +1421,6 @@ defaultToast: Toast { durationSlide: 160; } -callMuteMainBlobMinRadius: 57px; -callMuteMainBlobMaxRadius: 63px; -callMuteMinorBlobMinRadius: 64px; -callMuteMinorBlobMaxRadius: 74px; -callMuteMajorBlobMinRadius: 67px; -callMuteMajorBlobMaxRadius: 77px; - -callMuteButtonActiveInner: IconButton { - width: 136px; - height: 165px; -} -callMuteButtonLabel: FlatLabel(defaultFlatLabel) { - textFg: groupCallMembersFg; - style: TextStyle(defaultTextStyle) { - font: font(14px); - linkFont: font(14px); - linkFontOver: font(14px underline); - } -} -callMuteButtonSublabel: FlatLabel(defaultFlatLabel) { - textFg: groupCallMemberNotJoinedStatus; -} -callMuteButtonLabelsSkip: 5px; -callMuteButtonSublabelSkip: 19px; -callMuteButtonActive: CallButton { - button: callMuteButtonActiveInner; - bg: groupCallLive1; - bgSize: 100px; - bgPosition: point(18px, 18px); - outerRadius: 18px; - outerBg: callAnswerBgOuter; - label: callMuteButtonLabel; -} -callMuteButtonMuted: CallButton(callMuteButtonActive) { - bg: groupCallMuted1; - label: callMuteButtonLabel; -} -callMuteButtonConnecting: CallButton(callMuteButtonMuted) { - bg: callIconBg; - label: callMuteButtonLabel; -} -callMuteButtonLabelAdditional: 5px; - -callConnectingRadial: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) { - color: lightButtonFg; - thickness: 4px; - size: size(100px, 100px); -} - shakeShift: 4px; // Windows specific title