Add menuToggle style.

This commit is contained in:
John Preston 2019-09-20 14:10:25 +03:00
parent b4beb6abed
commit 82ccac3200
6 changed files with 38 additions and 10 deletions

BIN
icons/title_menu_dots.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

View file

@ -222,8 +222,8 @@ void DropdownMenu::childHiding(DropdownMenu *child) {
void DropdownMenu::hideFinish() {
_menu->clearSelection();
if (_hiddenCallback) {
_hiddenCallback();
if (const auto onstack = _hiddenCallback) {
onstack();
}
}

View file

@ -234,10 +234,13 @@ void InnerDropdown::hideFinished() {
_cache = QPixmap();
_ignoreShowEvents = false;
if (!isHidden()) {
if (_hiddenCallback) {
_hiddenCallback();
const auto weak = Ui::MakeWeak(this);
if (const auto onstack = _hiddenCallback) {
onstack();
}
if (weak) {
hide();
}
hide();
}
}
@ -256,19 +259,27 @@ void InnerDropdown::prepareCache() {
}
void InnerDropdown::startOpacityAnimation(bool hiding) {
const auto weak = Ui::MakeWeak(this);
if (hiding) {
if (_hideStartCallback) {
_hideStartCallback();
if (const auto onstack = _hideStartCallback) {
onstack();
}
} else if (_showStartCallback) {
_showStartCallback();
} else if (const auto onstack = _showStartCallback) {
onstack();
}
if (!weak) {
return;
}
_hiding = false;
prepareCache();
_hiding = hiding;
hideChildren();
_a_opacity.start([this] { opacityAnimationCallback(); }, _hiding ? 1. : 0., _hiding ? 0. : 1., _st.duration);
_a_opacity.start(
[=] { opacityAnimationCallback(); },
_hiding ? 1. : 0.,
_hiding ? 0. : 1.,
_st.duration);
}
void InnerDropdown::showStarted() {

View file

@ -1128,3 +1128,20 @@ defaultLevelMeter: LevelMeter {
activeFg: mediaPlayerActiveFg;
inactiveFg: mediaPlayerInactiveFg;
}
menuToggleIcon: icon {{ "title_menu_dots", menuIconFg }};
menuToggleIconOver: icon {{ "title_menu_dots", menuIconFgOver }};
menuToggle: IconButton {
width: 40px;
height: 40px;
icon: menuToggleIcon;
iconOver: menuToggleIconOver;
iconPosition: point(16px, 10px);
rippleAreaPosition: point(0px, 0px);
rippleAreaSize: 40px;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;
}
}