mirror of https://github.com/procxx/kepka.git
fixed OS X PopupMenu behaviour and directory name in error msg
This commit is contained in:
parent
29befef3ea
commit
9a83c26731
|
@ -20,8 +20,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
static const int32 AppVersion = 9008;
|
static const int32 AppVersion = 9009;
|
||||||
static const wchar_t *AppVersionStr = L"0.9.8";
|
static const wchar_t *AppVersionStr = L"0.9.9";
|
||||||
static const bool DevVersion = true;
|
static const bool DevVersion = true;
|
||||||
|
|
||||||
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
||||||
|
|
|
@ -50,6 +50,7 @@ PopupMenu::PopupMenu(QMenu *menu, const style::PopupMenu &st) : TWidget(0)
|
||||||
, _mouseSelection(false)
|
, _mouseSelection(false)
|
||||||
, _shadow(_st.shadow)
|
, _shadow(_st.shadow)
|
||||||
, _selected(-1)
|
, _selected(-1)
|
||||||
|
, _childMenuIndex(-1)
|
||||||
, a_opacity(1)
|
, a_opacity(1)
|
||||||
, _a_hide(animFunc(this, &PopupMenu::animStep_hide))
|
, _a_hide(animFunc(this, &PopupMenu::animStep_hide))
|
||||||
, _deleteOnHide(true) {
|
, _deleteOnHide(true) {
|
||||||
|
@ -301,11 +302,7 @@ void PopupMenu::keyPressEvent(QKeyEvent *e) {
|
||||||
|
|
||||||
void PopupMenu::enterEvent(QEvent *e) {
|
void PopupMenu::enterEvent(QEvent *e) {
|
||||||
QPoint mouse = QCursor::pos();
|
QPoint mouse = QCursor::pos();
|
||||||
if (_inner.marginsRemoved(QMargins(0, _st.skip, 0, _st.skip)).contains(mapFromGlobal(mouse))) {
|
if (!_inner.marginsRemoved(QMargins(0, _st.skip, 0, _st.skip)).contains(mapFromGlobal(mouse))) {
|
||||||
_mouseSelection = true;
|
|
||||||
_mouse = mouse;
|
|
||||||
updateSelected();
|
|
||||||
} else {
|
|
||||||
if (_mouseSelection && _childMenuIndex < 0) {
|
if (_mouseSelection && _childMenuIndex < 0) {
|
||||||
_mouseSelection = false;
|
_mouseSelection = false;
|
||||||
setSelected(-1);
|
setSelected(-1);
|
||||||
|
@ -385,6 +382,12 @@ void PopupMenu::focusOutEvent(QFocusEvent *e) {
|
||||||
hideMenu();
|
hideMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PopupMenu::hideEvent(QHideEvent *e) {
|
||||||
|
if (_deleteOnHide) {
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PopupMenu::hideMenu(bool fast) {
|
void PopupMenu::hideMenu(bool fast) {
|
||||||
if (isHidden()) return;
|
if (isHidden()) return;
|
||||||
if (_parent && !_a_hide.animating()) {
|
if (_parent && !_a_hide.animating()) {
|
||||||
|
@ -419,9 +422,6 @@ void PopupMenu::childHiding(PopupMenu *child) {
|
||||||
|
|
||||||
void PopupMenu::hideFinish() {
|
void PopupMenu::hideFinish() {
|
||||||
hide();
|
hide();
|
||||||
if (_deleteOnHide) {
|
|
||||||
deleteLater();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PopupMenu::animStep_hide(float64 ms) {
|
bool PopupMenu::animStep_hide(float64 ms) {
|
||||||
|
@ -482,6 +482,7 @@ void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, PressSource source)
|
||||||
}
|
}
|
||||||
move(w);
|
move(w);
|
||||||
|
|
||||||
|
_mouseSelection = (source == PressSourceMouse);
|
||||||
setSelected((source == PressSourceMouse || _actions.isEmpty()) ? -1 : 0);
|
setSelected((source == PressSourceMouse || _actions.isEmpty()) ? -1 : 0);
|
||||||
psUpdateOverlayed(this);
|
psUpdateOverlayed(this);
|
||||||
show();
|
show();
|
||||||
|
|
|
@ -47,6 +47,7 @@ protected:
|
||||||
void leaveEvent(QEvent *e);
|
void leaveEvent(QEvent *e);
|
||||||
void enterEvent(QEvent *e);
|
void enterEvent(QEvent *e);
|
||||||
void focusOutEvent(QFocusEvent *e);
|
void focusOutEvent(QFocusEvent *e);
|
||||||
|
void hideEvent(QHideEvent *e);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
|
@ -405,7 +405,7 @@ void FileLoadTask::finish() {
|
||||||
}
|
}
|
||||||
if (_result->filesize == -1) { // dir
|
if (_result->filesize == -1) { // dir
|
||||||
App::main()->onSendFileCancel(_result);
|
App::main()->onSendFileCancel(_result);
|
||||||
App::wnd()->replaceLayer(new InformBox(lng_send_folder(lt_name, QFileInfo(_filepath).fileName())));
|
App::wnd()->replaceLayer(new InformBox(lng_send_folder(lt_name, QFileInfo(_filepath).dir().dirName())));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_result->filesize > MaxUploadDocumentSize) {
|
if (_result->filesize > MaxUploadDocumentSize) {
|
||||||
|
|
Loading…
Reference in New Issue