From f030a7fb0c4740471665c9fdb6eab960ae47a5c1 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Sun, 7 Mar 2021 20:08:43 +0200 Subject: [PATCH] Remove deprecated and always disabled alwaysOnTopAction --- YACReader/configuration.cpp | 2 -- YACReader/configuration.h | 2 -- YACReader/main_window_viewer.cpp | 30 +--------------------- YACReader/main_window_viewer.h | 3 --- common/yacreader_global_gui.h | 1 - shortcuts_management/shortcuts_manager.cpp | 1 - shortcuts_management/shortcuts_manager.h | 1 - 7 files changed, 1 insertion(+), 39 deletions(-) diff --git a/YACReader/configuration.cpp b/YACReader/configuration.cpp index d45e945b..68a9d173 100644 --- a/YACReader/configuration.cpp +++ b/YACReader/configuration.cpp @@ -41,8 +41,6 @@ void Configuration::load(QSettings *settings) settings->setValue(DOUBLE_PAGE, false); if (!settings->contains(BACKGROUND_COLOR)) settings->setValue(BACKGROUND_COLOR, QColor(40, 40, 40)); - if (!settings->contains(ALWAYS_ON_TOP)) - settings->setValue(ALWAYS_ON_TOP, false); if (!settings->contains(SHOW_TOOLBARS)) settings->setValue(SHOW_TOOLBARS, true); if (!settings->contains(QUICK_NAVI_MODE)) diff --git a/YACReader/configuration.h b/YACReader/configuration.h index 513f129d..3c4649ea 100644 --- a/YACReader/configuration.h +++ b/YACReader/configuration.h @@ -69,8 +69,6 @@ public: QColor getBackgroundColor() { return settings->value(BACKGROUND_COLOR).value(); } void setBackgroundColor(const QColor &color) { settings->value(BACKGROUND_COLOR, color); } - bool getAlwaysOnTop() { return settings->value(ALWAYS_ON_TOP).toBool(); } - void setAlwaysOnTop(bool b) { settings->setValue(ALWAYS_ON_TOP, b); } bool getShowToolbars() { return settings->value(SHOW_TOOLBARS).toBool(); } void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); } bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); } diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 9d2fe02b..bc6d5e23 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -70,7 +70,7 @@ public: #endif*/ MainWindowViewer::MainWindowViewer() - : QMainWindow(), fullscreen(false), toolbars(true), alwaysOnTop(false), currentDirectory("."), currentDirectoryImgDest("."), isClient(false) + : QMainWindow(), fullscreen(false), toolbars(true), currentDirectory("."), currentDirectoryImgDest("."), isClient(false) { loadConfiguration(); setupUI(); @@ -118,7 +118,6 @@ MainWindowViewer::~MainWindowViewer() delete showInfoAction; delete closeAction; delete showDictionaryAction; - delete alwaysOnTopAction; delete adjustToFullSizeAction; delete fitToPageAction; delete showFlowAction; @@ -189,11 +188,6 @@ void MainWindowViewer::setupUI() viewer->setFocusPolicy(Qt::StrongFocus); - // if(Configuration::getConfiguration().getAlwaysOnTop()) - //{ - // setWindowFlags(this->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint); - // } - previousWindowFlags = windowFlags(); previousPos = pos(); previousSize = size(); @@ -485,16 +479,6 @@ void MainWindowViewer::createActions() showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y)); connect(showDictionaryAction, &QAction::triggered, viewer, &Viewer::translatorSwitch); - // deprecated - alwaysOnTopAction = new QAction(tr("Always on top"), this); - alwaysOnTopAction->setIcon(QIcon(":/images/alwaysOnTop.png")); - alwaysOnTopAction->setCheckable(true); - alwaysOnTopAction->setDisabled(true); - alwaysOnTopAction->setChecked(Configuration::getConfiguration().getAlwaysOnTop()); - alwaysOnTopAction->setData(ALWAYS_ON_TOP_ACTION_Y); - alwaysOnTopAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ALWAYS_ON_TOP_ACTION_Y)); - connect(alwaysOnTopAction, &QAction::triggered, this, &MainWindowViewer::alwaysOnTopSwitch); - showFlowAction = new QAction(tr("Show go to flow"), this); showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png")); showFlowAction->setData(SHOW_FLOW_ACTION_Y); @@ -1579,18 +1563,6 @@ void MainWindowViewer::dragEnterEvent(QDragEnterEvent *event) } } -void MainWindowViewer::alwaysOnTopSwitch() -{ - if (!Configuration::getConfiguration().getAlwaysOnTop()) { - setWindowFlags(this->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint); // always on top - show(); - } else { - setWindowFlags(this->windowFlags() ^ (Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint)); - show(); - } - Configuration::getConfiguration().setAlwaysOnTop(!Configuration::getConfiguration().getAlwaysOnTop()); -} - void MainWindowViewer::adjustToFullSizeSwitch() { Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullRes); diff --git a/YACReader/main_window_viewer.h b/YACReader/main_window_viewer.h index 01830a10..4bfc76c7 100644 --- a/YACReader/main_window_viewer.h +++ b/YACReader/main_window_viewer.h @@ -59,7 +59,6 @@ public slots: void openComic(QString pathFile); void openFolderFromPath(QString pathDir); void openFolderFromPath(QString pathFile, QString atFileName); - void alwaysOnTopSwitch(); void adjustToFullSizeSwitch(); void fitToPageSwitch(); void resetZoomLevel(); @@ -85,7 +84,6 @@ private: //! State bool fullscreen; bool toolbars; - bool alwaysOnTop; bool fromMaximized; // QTBUG-41883 @@ -139,7 +137,6 @@ private: QAction *doubleMangaPageAction; QAction *showShorcutsAction; QAction *showDictionaryAction; - QAction *alwaysOnTopAction; QAction *adjustToFullSizeAction; QAction *fitToPageAction; QAction *resetZoomAction; diff --git a/common/yacreader_global_gui.h b/common/yacreader_global_gui.h index 3c951396..330ff3ac 100644 --- a/common/yacreader_global_gui.h +++ b/common/yacreader_global_gui.h @@ -24,7 +24,6 @@ #define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE" #define COVER_IS_SP "COVER_IS_SP" #define BACKGROUND_COLOR "BACKGROUND_COLOR" -#define ALWAYS_ON_TOP "ALWAYS_ON_TOP" #define SHOW_TOOLBARS "SHOW_TOOLBARS" #define BRIGHTNESS "BRIGHTNESS" #define CONTRAST "CONTRAST" diff --git a/shortcuts_management/shortcuts_manager.cpp b/shortcuts_management/shortcuts_manager.cpp index b1593611..deb7df9b 100644 --- a/shortcuts_management/shortcuts_manager.cpp +++ b/shortcuts_management/shortcuts_manager.cpp @@ -52,7 +52,6 @@ void ShortcutsManager::initDefaultShorcuts() defaultShorcuts.insert(SHOW_INFO_ACTION_Y, Qt::Key_I); defaultShorcuts.insert(CLOSE_ACTION_Y, Qt::Key_Escape); defaultShorcuts.insert(SHOW_DICTIONARY_ACTION_Y, Qt::Key_T); - defaultShorcuts.insert(ALWAYS_ON_TOP_ACTION_Y, Qt::Key_Q); // deprecated defaultShorcuts.insert(ADJUST_TO_FULL_SIZE_ACTION_Y, Qt::Key_W); defaultShorcuts.insert(SHOW_FLOW_ACTION_Y, Qt::Key_S); defaultShorcuts.insert(ZOOM_PLUS_ACTION_Y, Qt::Key_Plus); diff --git a/shortcuts_management/shortcuts_manager.h b/shortcuts_management/shortcuts_manager.h index 26f751a0..2201296d 100644 --- a/shortcuts_management/shortcuts_manager.h +++ b/shortcuts_management/shortcuts_manager.h @@ -116,7 +116,6 @@ public: #define SHOW_INFO_ACTION_Y "SHOW_INFO_ACTION_Y" #define CLOSE_ACTION_Y "CLOSE_ACTION_Y" #define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_ACTION_Y" -#define ALWAYS_ON_TOP_ACTION_Y "ALWAYS_ON_TOP_ACTION_Y" #define ADJUST_TO_FULL_SIZE_ACTION_Y "ADJUST_TO_FULL_SIZE_ACTION_Y" #define FIT_TO_PAGE_ACTION_Y "FIT_TO_PAGE_ACTION_Y" #define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y"