Remove deprecated and always disabled alwaysOnTopAction

This commit is contained in:
Igor Kushnir 2021-03-07 20:08:43 +02:00
parent b3c99823eb
commit f030a7fb0c
7 changed files with 1 additions and 39 deletions

View File

@ -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))

View File

@ -69,8 +69,6 @@ public:
QColor getBackgroundColor() { return settings->value(BACKGROUND_COLOR).value<QColor>(); }
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(); }

View File

@ -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);

View File

@ -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;

View File

@ -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"

View File

@ -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);

View File

@ -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"