Add menuToggle style.
This commit is contained in:
parent
b4beb6abed
commit
82ccac3200
6 changed files with 38 additions and 10 deletions
BIN
icons/title_menu_dots.png
Normal file
BIN
icons/title_menu_dots.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 130 B |
BIN
icons/title_menu_dots@2x.png
Normal file
BIN
icons/title_menu_dots@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 212 B |
BIN
icons/title_menu_dots@3x.png
Normal file
BIN
icons/title_menu_dots@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 311 B |
|
|
@ -222,8 +222,8 @@ void DropdownMenu::childHiding(DropdownMenu *child) {
|
|||
|
||||
void DropdownMenu::hideFinish() {
|
||||
_menu->clearSelection();
|
||||
if (_hiddenCallback) {
|
||||
_hiddenCallback();
|
||||
if (const auto onstack = _hiddenCallback) {
|
||||
onstack();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,12 +234,15 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InnerDropdown::prepareCache() {
|
||||
if (_a_opacity.animating()) return;
|
||||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue