From e7b6d7b49845bb2b7dcad9b36820b129a5336b84 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 5 Oct 2016 21:37:48 +0300 Subject: [PATCH] Advanced notifications settings box layout done. --- Telegram/Resources/icons/monitor.png | Bin 0 -> 3962 bytes Telegram/Resources/icons/monitor@2x.png | Bin 0 -> 10782 bytes Telegram/Resources/langs/lang.strings | 3 + Telegram/SourceFiles/boxes/boxes.style | 9 + .../SourceFiles/boxes/notifications_box.cpp | 108 ++++++++++++ .../SourceFiles/boxes/notifications_box.h | 52 ++++++ Telegram/SourceFiles/settings/settings.style | 11 -- .../settings_notifications_widget.cpp | 15 ++ .../settings/settings_notifications_widget.h | 2 + .../settings/settings_scale_widget.cpp | 134 +-------------- .../settings/settings_scale_widget.h | 53 +----- .../ui/widgets/discrete_slider.cpp | 161 ++++++++++++++++++ .../SourceFiles/ui/widgets/discrete_slider.h | 72 ++++++++ Telegram/SourceFiles/ui/widgets/widgets.style | 11 ++ Telegram/gyp/Telegram.gyp | 4 + 15 files changed, 443 insertions(+), 192 deletions(-) create mode 100644 Telegram/Resources/icons/monitor.png create mode 100644 Telegram/Resources/icons/monitor@2x.png create mode 100644 Telegram/SourceFiles/boxes/notifications_box.cpp create mode 100644 Telegram/SourceFiles/boxes/notifications_box.h create mode 100644 Telegram/SourceFiles/ui/widgets/discrete_slider.cpp create mode 100644 Telegram/SourceFiles/ui/widgets/discrete_slider.h diff --git a/Telegram/Resources/icons/monitor.png b/Telegram/Resources/icons/monitor.png new file mode 100644 index 0000000000000000000000000000000000000000..b1829c2b790ff36e8c9d4b2c7b18b16ea987c7b2 GIT binary patch literal 3962 zcmd5KaJIIT&eoBL z?z9563;D2%2M~G734C%QVe#EF0t(O6(bgIHDf(l+?D zPZxW$6bXcoVT5$5F&Mk>ksf7n|34XDU5ywuin{J+iBc3@PE5U6&;>W@`rh<4ie;sn zMbiMFMksD9YcXlyfxPnfp=u|(x-=z72mJhzvQgh`!b-EjNgsfSqz#^}C>UH%8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$vCj)bS=#aTTDV z8l2ob`*ejz={Ho`icuZxUp|`u2)>L1c^xA&&V=2Z>vOpct0RX^5Wfh>1WC+b zG}1jZl;{h)@$@b36ZZ%S5Z#>HM6K>Noxd>_%fM@NM(A*EbA?FuI*#-EJUc!H;g^j;tVH?no+xSvCqUn|p|mtOO-VM5mI*`% ztAnbzDJik;T~pK>6DrlcE?}%)W6L&m#sX4?!!CX?`*6x-B)7>Ok2ET9!wxAJ7=P*TqTrS4uuqrZ;*UrtU4!Wm?@&#_J~#a-3ghXQ?YJs z7bOoS2u!=;FB@5H{8lLzdipbB-QehLTxZ+X14B5ByR$=pdP6yyvjl=4&ztKw9f~PD z1%(ysyID4Yo6(B>W~6#CoY)i+F5?Qh;f_D+xEOtO@cot0J9iw#cQ*N-hHcfYlDr9%Ba zSA&)yFMv8_e%P8f)mjU*Z%)(UFL}>C)P#g%f?J}aJz|=x+8I^&T0DC>rd-h=sh&eK zJp-pdUw^vi__R`dMKkG}prGyGN6GyEv$QnXBJvhEDr$XkquphMnvh@iSpj5>{ET^UE(gXC&yG|1nZsIn3IS^FK=-|qf6{DT-YH4>hnBiX3|Ue*sXg BQjP!s literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/monitor@2x.png b/Telegram/Resources/icons/monitor@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..42356354f969d761a131de29d1468241ba87f236 GIT binary patch literal 10782 zcmeHNX*`tgyC1S;i9%#e*@^6A3nfb(NF$otI5 zY~jie)la|qQ3!blU0&p6;?rWoz~cz~RB(ItQIrqg54hbc%tkcxr?AW9Np_uA99uuK zrU(`a+=?GYT9PD`l!^Jv0dS**=lkNxlK7I8C3F+-+tkd=sT3It85MP?>aI!LpBHq> z%F2g-gw9gbHeN9`^PXl< z`c`3{swQyk-)F;4*=QGjU8laxk@e%=^+iPJKB5dblCl`>vXfXAbies@rCDOh!yuOo z1UhD43Lm{0tCBPQH+tGoZ>gn|k)k*{n&D(T>m-He#Uh{XYcUY$rNZEw;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b^bB0mxPs}z>``+ z7P1$l@rhV4M?c_ZP_j?_J%Y@U}l^~4^ngJN0pfTXR*7asHs~# zH0Ch$Pu7M`CRR<8Ri{=KpkqoEbnORdePoo>muuf8Aik|pLDeRQ<T$lkYj^1j)iagEB+3s02NYo{#ksv*I& z6GA3oYPjsU$Yx*-LHK<3ck=9j=FIOUf*0^PxAmR<9G=sjz9svtzpr^tc+ZSOw`)U- zfIAlh$;Q7(iS>0c$FZ+#F%{2}Wgi<2(-|!EC}X&%mQcJ; z+_ny09?BZ*3);|tM+iaycIqsCeJle(kkCyvm>eAXQE83+ny+7GJqTP*IfQ<}9|cZe8_G_)OoqBL z(L=?J_#?fwrad8MltZdPzBGO=dr?K5qtoMQCwp_py0nIrbIr|amR#y~^g#ACXGM2e zE_ykxSXqvk>ZT_2rhoQtZ?M~n+Y{c{uT4#bn-gX$v!CVVYrZyCp?=#IFy(50`(dkM2i)HFZE34y9&wsZ?%pL;xl>_kmT6?y_ zAoJ%4U||Osz*2^t6;(F$*;%G++hZN?TAtX9nM&NmVkDYg=pvtQ4hl3L59-$k9Z35= kZn+F37U1Qvy)!ajHos=o&)0#ARS-z`zQMgxP1~^l0CKzDa{vGU literal 0 HcmV?d00001 diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 15295e8b5..c8384625e 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -245,6 +245,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_show_preview" = "Show message preview"; "lng_settings_use_windows" = "Use Windows notifications"; "lng_settings_use_native_notifications" = "Use native notifications"; +"lng_settings_advanced_notifications" = "Notifications position and count"; +"lng_settings_notifications_position" = "Location on the screen"; +"lng_settings_notifications_count" = "Notifications count"; "lng_settings_sound_notify" = "Play sound"; "lng_settings_include_muted" = "Include muted chats in unread count"; diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 61f024f8b..971ea807c 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -89,3 +89,12 @@ shareColumnSkip: 6px; shareSelectDuration: 150; shareActivateDuration: 150; shareScrollDuration: 300; + +notificationsBoxHeight: 450px; +notificationsBoxMonitorTop: 63px; +notificationsBoxMonitor: icon {{ "monitor", #000000 }}; +notificationsBoxScreenTop: 10px; +notificationsBoxScreenSize: size(280px, 160px); +notificationsBoxScreenBg: titleBg; +notificationsBoxCountLabelTop: 80px; +notificationsBoxCountTop: 30px; diff --git a/Telegram/SourceFiles/boxes/notifications_box.cpp b/Telegram/SourceFiles/boxes/notifications_box.cpp new file mode 100644 index 000000000..74909368c --- /dev/null +++ b/Telegram/SourceFiles/boxes/notifications_box.cpp @@ -0,0 +1,108 @@ +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#include "stdafx.h" +#include "boxes/notifications_box.h" + +#include "lang.h" +#include "ui/buttons/round_button.h" +#include "ui/widgets/discrete_slider.h" +#include "styles/style_boxes.h" + +namespace { + +constexpr int kMaxNotificationsCount = 5; + +} // namespace + +NotificationsBox::NotificationsBox() : AbstractBox() +, _countSlider(this) +, _save(this, lang(lng_settings_save), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) { + for (int i = 0; i != kMaxNotificationsCount; ++i) { + _countSlider->addSection(QString::number(i + 1)); + } + _countSlider->setActiveSectionFast(2); + + setMouseTracking(true); + _save->setClickedCallback([this] { + + }); + connect(_cancel, SIGNAL(clicked()), this, SLOT(onClose())); + + setMaxHeight(st::notificationsBoxHeight); + + prepare(); +} + +void NotificationsBox::paintEvent(QPaintEvent *e) { + Painter p(this); + if (paint(p)) return; + + auto contentLeft = getContentLeft(); + + p.setFont(st::boxTitleFont); + p.setPen(st::boxTitleFg); + p.drawTextLeft(contentLeft, st::boxTitlePosition.y(), width(), lang(lng_settings_notifications_position)); + + auto screenLeft = (width() - st::notificationsBoxScreenSize.width()) / 2; + auto screenRect = getScreenRect(); + p.fillRect(screenRect.x(), screenRect.y(), st::notificationsBoxScreenSize.width(), st::notificationsBoxScreenSize.height(), st::notificationsBoxScreenBg); + + auto monitorTop = st::notificationsBoxMonitorTop; + st::notificationsBoxMonitor.paint(p, contentLeft, monitorTop, width()); + + auto labelTop = screenRect.y() + screenRect.height() + st::notificationsBoxCountLabelTop; + p.drawTextLeft(contentLeft, labelTop, width(), lang(lng_settings_notifications_count)); +} + +int NotificationsBox::getContentLeft() const { + return (width() - st::notificationsBoxMonitor.width()) / 2; +} + +QRect NotificationsBox::getScreenRect() const { + auto screenLeft = (width() - st::notificationsBoxScreenSize.width()) / 2; + auto screenTop = st::notificationsBoxMonitorTop + st::notificationsBoxScreenTop; + return QRect(screenLeft, screenTop, st::notificationsBoxScreenSize.width(), st::notificationsBoxScreenSize.height()); +} + +void NotificationsBox::resizeEvent(QResizeEvent *e) { + _save->moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _save->height()); + _cancel->moveToRight(st::boxButtonPadding.right() + _save->width() + st::boxButtonPadding.left(), _save->y()); + + auto screenRect = getScreenRect(); + auto sliderTop = screenRect.y() + screenRect.height() + st::notificationsBoxCountLabelTop + st::notificationsBoxCountTop; + auto contentLeft = getContentLeft(); + _countSlider->resizeToWidth(width() - 2 * contentLeft); + _countSlider->move(contentLeft, sliderTop); + AbstractBox::resizeEvent(e); +} + +void NotificationsBox::mousePressEvent(QMouseEvent *e) { + +} + +void NotificationsBox::mouseMoveEvent(QMouseEvent *e) { + +} + +void NotificationsBox::mouseReleaseEvent(QMouseEvent *e) { + +} diff --git a/Telegram/SourceFiles/boxes/notifications_box.h b/Telegram/SourceFiles/boxes/notifications_box.h new file mode 100644 index 000000000..14cc0ab34 --- /dev/null +++ b/Telegram/SourceFiles/boxes/notifications_box.h @@ -0,0 +1,52 @@ +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#pragma once + +#include "abstractbox.h" + +class BoxButton; +class LinkButton; + +namespace Ui { +class DiscreteSlider; +} // namespace Ui + +class NotificationsBox : public AbstractBox { + Q_OBJECT + +public: + NotificationsBox(); + +protected: + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + +private: + QRect getScreenRect() const; + int getContentLeft() const; + + ChildWidget _countSlider; + ChildWidget _save, _cancel; + +}; diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index bf41030ca..0bb31a9a5 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -125,17 +125,6 @@ settingsLargeSkip: 23px; settingsActionPadding: margins(0px, 4px, 0px, 5px); -settingsSliderHeight: 39px; -settingsSliderTop: 5px; -settingsSliderSkip: 3px; -settingsSliderThickness: 3px; -settingsSliderActiveFg: #4bb5e7; -settingsSliderInactiveFg: #e1eaef; -settingsSliderLabelTop: 17px; -settingsSliderLabelFont: normalFont; -settingsSliderLabelFg: #1485c2; -settingsSliderDuration: 200; - settingsBackgroundSize: 120px; settingsUpdateFg: #999999; diff --git a/Telegram/SourceFiles/settings/settings_notifications_widget.cpp b/Telegram/SourceFiles/settings/settings_notifications_widget.cpp index 03370744b..3db9684e1 100644 --- a/Telegram/SourceFiles/settings/settings_notifications_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications_widget.cpp @@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "ui/flatcheckbox.h" #include "mainwindow.h" #include "window/notifications_manager.h" +#include "boxes/notifications_box.h" namespace Settings { @@ -74,6 +75,10 @@ void NotificationsWidget::createControls() { if (!nativeNotificationsLabel.isEmpty()) { addChildRow(_nativeNotifications, margin, nativeNotificationsLabel, SLOT(onNativeNotifications()), Global::NativeNotifications()); } + addChildRow(_advanced, margin, slidedPadding, lang(lng_settings_advanced_notifications), SLOT(onAdvanced())); + if (!nativeNotificationsLabel.isEmpty() && Global::NativeNotifications()) { + _advanced->hideFast(); + } } void NotificationsWidget::onDesktopNotifications() { @@ -149,6 +154,16 @@ void NotificationsWidget::onNativeNotifications() { Window::Notifications::manager()->clearAllFast(); Global::SetNativeNotifications(_nativeNotifications->checked()); Local::writeUserSettings(); + + if (Global::NativeNotifications()) { + _advanced->slideUp(); + } else { + _advanced->slideDown(); + } +} + +void NotificationsWidget::onAdvanced() { + Ui::showLayer(new NotificationsBox()); } void NotificationsWidget::onPlaySound() { diff --git a/Telegram/SourceFiles/settings/settings_notifications_widget.h b/Telegram/SourceFiles/settings/settings_notifications_widget.h index 3c68f1c34..dd07c6e3f 100644 --- a/Telegram/SourceFiles/settings/settings_notifications_widget.h +++ b/Telegram/SourceFiles/settings/settings_notifications_widget.h @@ -37,6 +37,7 @@ private slots: void onNativeNotifications(); void onPlaySound(); void onIncludeMuted(); + void onAdvanced(); private: void createControls(); @@ -49,6 +50,7 @@ private: ChildWidget _nativeNotifications = { nullptr }; ChildWidget _playSound = { nullptr }; ChildWidget _includeMuted = { nullptr }; + ChildWidget> _advanced = { nullptr }; }; diff --git a/Telegram/SourceFiles/settings/settings_scale_widget.cpp b/Telegram/SourceFiles/settings/settings_scale_widget.cpp index 7660e5050..82237a48d 100644 --- a/Telegram/SourceFiles/settings/settings_scale_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_scale_widget.cpp @@ -27,6 +27,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mainwindow.h" #include "boxes/confirmbox.h" #include "application.h" +#include "ui/widgets/discrete_slider.h" namespace Settings { namespace { @@ -43,139 +44,6 @@ QString scaleLabel(DBIScale scale) { } // namespace -Slider::Slider(QWidget *parent) : TWidget(parent) -, _a_left(animation(this, &Slider::step_left)) { - setCursor(style::cur_pointer); -} - -void Slider::setActiveSection(int index) { - setSelectedSection(index); - if (_activeIndex != index) { - _activeIndex = index; - emit sectionActivated(); - } -} - -void Slider::setActiveSectionFast(int index) { - setActiveSection(index); - a_left.finish(); - _a_left.stop(); - update(); -} - -void Slider::addSection(const QString &label) { - auto section = Section(label); - _sections.push_back(section); -} - -void Slider::resizeSections(int newWidth) { - auto count = _sections.size(); - if (!count) return; - - auto skips = count - 1; - auto sectionsWidth = newWidth - skips * st::settingsSliderSkip; - auto sectionWidth = sectionsWidth / float64(count); - auto x = 0.; - for (int i = 0; i != count; ++i) { - auto §ion = _sections[i]; - auto skip = i * st::settingsSliderThickness; - section.left = qFloor(x) + skip; - x += sectionWidth; - section.width = qRound(x) - (section.left - skip); - } - a_left = anim::ivalue(_sections[_activeIndex].left, _sections[_activeIndex].left); - _a_left.stop(); -} - -void Slider::mousePressEvent(QMouseEvent *e) { - setSelectedSection(getIndexFromPosition(e->pos())); - _pressed = true; -} - -void Slider::mouseMoveEvent(QMouseEvent *e) { - if (!_pressed) return; - setSelectedSection(getIndexFromPosition(e->pos())); -} - -void Slider::mouseReleaseEvent(QMouseEvent *e) { - if (!_pressed) return; - _pressed = false; - setActiveSection(getIndexFromPosition(e->pos())); -} - -void Slider::setSelectedSection(int index) { - if (index < 0) return; - - if (_selected != index) { - _selected = index; - a_left.start(_sections[_selected].left); - _a_left.start(); - } -} - -void Slider::paintEvent(QPaintEvent *e) { - Painter p(this); - - int activeLeft = a_left.current(); - - p.setFont(st::settingsSliderLabelFont); - p.setPen(st::settingsSliderLabelFg); - for (int i = 0, count = _sections.size(); i != count; ++i) { - auto §ion = _sections.at(i); - auto from = section.left, tofill = section.width; - if (activeLeft > from) { - auto fill = qMin(tofill, activeLeft - from); - p.fillRect(myrtlrect(from, st::settingsSliderTop, fill, st::settingsSliderThickness), st::settingsSliderInactiveFg); - from += fill; - tofill -= fill; - } - if (activeLeft + section.width > from) { - if (auto fill = qMin(tofill, activeLeft + section.width - from)) { - p.fillRect(myrtlrect(from, st::settingsSliderTop, fill, st::settingsSliderThickness), st::settingsSliderActiveFg); - from += fill; - tofill -= fill; - } - } - if (tofill) { - p.fillRect(myrtlrect(from, st::settingsSliderTop, tofill, st::settingsSliderThickness), st::settingsSliderInactiveFg); - } - p.drawTextLeft(section.left + (section.width - section.labelWidth) / 2, st::settingsSliderLabelTop, width(), section.label, section.labelWidth); - } -} - -int Slider::resizeGetHeight(int newWidth) { - resizeSections(newWidth); - return st::settingsSliderHeight; -} - -int Slider::getIndexFromPosition(QPoint pos) { - int count = _sections.size(); - for (int i = 0; i != count; ++i) { - if (_sections[i].left + _sections[i].width > pos.x()) { - return i; - } - } - return count - 1; -} - -void Slider::step_left(float64 ms, bool timer) { - auto dt = ms / st::settingsSliderDuration; - if (dt >= 1) { - a_left.finish(); - _a_left.stop(); - } else { - a_left.update(dt, anim::linear); - } - if (timer) { - update(); - } -} - -Slider::Section::Section(const QString &label) -: label(label) -, labelWidth(st::settingsSliderLabelFont->width(label)) { -} - ScaleWidget::ScaleWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_scale)) { createControls(); } diff --git a/Telegram/SourceFiles/settings/settings_scale_widget.h b/Telegram/SourceFiles/settings/settings_scale_widget.h index 1a4485c45..d518b253c 100644 --- a/Telegram/SourceFiles/settings/settings_scale_widget.h +++ b/Telegram/SourceFiles/settings/settings_scale_widget.h @@ -24,55 +24,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org class Checkbox; +namespace Ui { +class DiscreteSlider; +} // namespace Ui + namespace Settings { -class Slider : public TWidget { - Q_OBJECT - -public: - Slider(QWidget *parent); - - int activeSection() const { - return _activeIndex; - } - void setActiveSection(int index); - void setActiveSectionFast(int index); - void addSection(const QString &label); - -protected: - void paintEvent(QPaintEvent *e) override; - void mousePressEvent(QMouseEvent *e) override; - void mouseMoveEvent(QMouseEvent *e) override; - void mouseReleaseEvent(QMouseEvent *e) override; - - int resizeGetHeight(int newWidth) override; - -signals: - void sectionActivated(); - -private: - void resizeSections(int newWidth); - int getIndexFromPosition(QPoint pos); - void setSelectedSection(int index); - void step_left(float64 ms, bool timer); - - struct Section { - Section(const QString &label); - - int left, width; - QString label; - int labelWidth; - }; - QList

_sections; - int _activeIndex = 0; - - bool _pressed = false; - int _selected = 0; - anim::ivalue a_left = { 0 }; - Animation _a_left; - -}; - class ScaleWidget : public BlockWidget { Q_OBJECT @@ -89,7 +46,7 @@ private: void setScale(DBIScale newScale); ChildWidget _auto = { nullptr }; - ChildWidget _scale = { nullptr }; + ChildWidget _scale = { nullptr }; }; diff --git a/Telegram/SourceFiles/ui/widgets/discrete_slider.cpp b/Telegram/SourceFiles/ui/widgets/discrete_slider.cpp new file mode 100644 index 000000000..65486067b --- /dev/null +++ b/Telegram/SourceFiles/ui/widgets/discrete_slider.cpp @@ -0,0 +1,161 @@ +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#include "stdafx.h" +#include "ui/widgets/discrete_slider.h" + +#include "styles/style_widgets.h" + +namespace Ui { + +DiscreteSlider::DiscreteSlider(QWidget *parent) : TWidget(parent) +, _a_left(animation(this, &DiscreteSlider::step_left)) { + setCursor(style::cur_pointer); +} + +void DiscreteSlider::setActiveSection(int index) { + setSelectedSection(index); + if (_activeIndex != index) { + _activeIndex = index; + emit sectionActivated(); + } +} + +void DiscreteSlider::setActiveSectionFast(int index) { + setActiveSection(index); + a_left.finish(); + _a_left.stop(); + update(); +} + +void DiscreteSlider::addSection(const QString &label) { + auto section = Section(label); + _sections.push_back(section); +} + +void DiscreteSlider::resizeSections(int newWidth) { + auto count = _sections.size(); + if (!count) return; + + auto skips = count - 1; + auto sectionsWidth = newWidth - skips * st::discreteSliderSkip; + auto sectionWidth = sectionsWidth / float64(count); + auto x = 0.; + for (int i = 0; i != count; ++i) { + auto §ion = _sections[i]; + auto skip = i * st::discreteSliderThickness; + section.left = qFloor(x) + skip; + x += sectionWidth; + section.width = qRound(x) - (section.left - skip); + } + a_left = anim::ivalue(_sections[_activeIndex].left, _sections[_activeIndex].left); + _a_left.stop(); +} + +void DiscreteSlider::mousePressEvent(QMouseEvent *e) { + setSelectedSection(getIndexFromPosition(e->pos())); + _pressed = true; +} + +void DiscreteSlider::mouseMoveEvent(QMouseEvent *e) { + if (!_pressed) return; + setSelectedSection(getIndexFromPosition(e->pos())); +} + +void DiscreteSlider::mouseReleaseEvent(QMouseEvent *e) { + if (!_pressed) return; + _pressed = false; + setActiveSection(getIndexFromPosition(e->pos())); +} + +void DiscreteSlider::setSelectedSection(int index) { + if (index < 0) return; + + if (_selected != index) { + _selected = index; + a_left.start(_sections[_selected].left); + _a_left.start(); + } +} + +void DiscreteSlider::paintEvent(QPaintEvent *e) { + Painter p(this); + + int activeLeft = a_left.current(); + + p.setFont(st::discreteSliderLabelFont); + p.setPen(st::discreteSliderLabelFg); + for (int i = 0, count = _sections.size(); i != count; ++i) { + auto §ion = _sections.at(i); + auto from = section.left, tofill = section.width; + if (activeLeft > from) { + auto fill = qMin(tofill, activeLeft - from); + p.fillRect(myrtlrect(from, st::discreteSliderTop, fill, st::discreteSliderThickness), st::discreteSliderInactiveFg); + from += fill; + tofill -= fill; + } + if (activeLeft + section.width > from) { + if (auto fill = qMin(tofill, activeLeft + section.width - from)) { + p.fillRect(myrtlrect(from, st::discreteSliderTop, fill, st::discreteSliderThickness), st::discreteSliderActiveFg); + from += fill; + tofill -= fill; + } + } + if (tofill) { + p.fillRect(myrtlrect(from, st::discreteSliderTop, tofill, st::discreteSliderThickness), st::discreteSliderInactiveFg); + } + p.drawTextLeft(section.left + (section.width - section.labelWidth) / 2, st::discreteSliderLabelTop, width(), section.label, section.labelWidth); + } +} + +int DiscreteSlider::resizeGetHeight(int newWidth) { + resizeSections(newWidth); + return st::discreteSliderHeight; +} + +int DiscreteSlider::getIndexFromPosition(QPoint pos) { + int count = _sections.size(); + for (int i = 0; i != count; ++i) { + if (_sections[i].left + _sections[i].width > pos.x()) { + return i; + } + } + return count - 1; +} + +void DiscreteSlider::step_left(float64 ms, bool timer) { + auto dt = ms / st::discreteSliderDuration; + if (dt >= 1) { + a_left.finish(); + _a_left.stop(); + } else { + a_left.update(dt, anim::linear); + } + if (timer) { + update(); + } +} + +DiscreteSlider::Section::Section(const QString &label) +: label(label) +, labelWidth(st::discreteSliderLabelFont->width(label)) { +} + +} // namespace Ui diff --git a/Telegram/SourceFiles/ui/widgets/discrete_slider.h b/Telegram/SourceFiles/ui/widgets/discrete_slider.h new file mode 100644 index 000000000..3235e00ec --- /dev/null +++ b/Telegram/SourceFiles/ui/widgets/discrete_slider.h @@ -0,0 +1,72 @@ +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#pragma once + +namespace Ui { + +class DiscreteSlider : public TWidget { + Q_OBJECT + +public: + DiscreteSlider(QWidget *parent); + + int activeSection() const { + return _activeIndex; + } + void setActiveSection(int index); + void setActiveSectionFast(int index); + void addSection(const QString &label); + +protected: + void paintEvent(QPaintEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + + int resizeGetHeight(int newWidth) override; + +signals: + void sectionActivated(); + +private: + void resizeSections(int newWidth); + int getIndexFromPosition(QPoint pos); + void setSelectedSection(int index); + void step_left(float64 ms, bool timer); + + struct Section { + Section(const QString &label); + + int left, width; + QString label; + int labelWidth; + }; + QList
_sections; + int _activeIndex = 0; + + bool _pressed = false; + int _selected = 0; + anim::ivalue a_left = { 0 }; + Animation _a_left; + +}; + +} // namespace Ui diff --git a/Telegram/SourceFiles/ui/widgets/widgets.style b/Telegram/SourceFiles/ui/widgets/widgets.style index 53f5e17d6..de5690e48 100644 --- a/Telegram/SourceFiles/ui/widgets/widgets.style +++ b/Telegram/SourceFiles/ui/widgets/widgets.style @@ -34,3 +34,14 @@ defaultLabelSimple: LabelSimple { } widgetSlideDuration: 200; + +discreteSliderHeight: 39px; +discreteSliderTop: 5px; +discreteSliderSkip: 3px; +discreteSliderThickness: 3px; +discreteSliderActiveFg: #4bb5e7; +discreteSliderInactiveFg: #e1eaef; +discreteSliderLabelTop: 17px; +discreteSliderLabelFont: normalFont; +discreteSliderLabelFg: #1485c2; +discreteSliderDuration: 200; diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp index 8f096ee36..79e4169ba 100644 --- a/Telegram/gyp/Telegram.gyp +++ b/Telegram/gyp/Telegram.gyp @@ -176,6 +176,8 @@ '<(src_loc)/boxes/languagebox.h', '<(src_loc)/boxes/localstoragebox.cpp', '<(src_loc)/boxes/localstoragebox.h', + '<(src_loc)/boxes/notifications_box.cpp', + '<(src_loc)/boxes/notifications_box.h', '<(src_loc)/boxes/passcodebox.cpp', '<(src_loc)/boxes/passcodebox.h', '<(src_loc)/boxes/photocropbox.cpp', @@ -453,6 +455,8 @@ '<(src_loc)/ui/widgets/label_simple.cpp', '<(src_loc)/ui/widgets/label_simple.h', '<(src_loc)/ui/widgets/widget_slide_wrap.h', + '<(src_loc)/ui/widgets/discrete_slider.cpp', + '<(src_loc)/ui/widgets/discrete_slider.h', '<(src_loc)/ui/animation.cpp', '<(src_loc)/ui/animation.h', '<(src_loc)/ui/button.cpp',