mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Remove deprecated and always disabled alwaysOnTopAction
This commit is contained in:
parent
b3c99823eb
commit
f030a7fb0c
@ -41,8 +41,6 @@ void Configuration::load(QSettings *settings)
|
|||||||
settings->setValue(DOUBLE_PAGE, false);
|
settings->setValue(DOUBLE_PAGE, false);
|
||||||
if (!settings->contains(BACKGROUND_COLOR))
|
if (!settings->contains(BACKGROUND_COLOR))
|
||||||
settings->setValue(BACKGROUND_COLOR, QColor(40, 40, 40));
|
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))
|
if (!settings->contains(SHOW_TOOLBARS))
|
||||||
settings->setValue(SHOW_TOOLBARS, true);
|
settings->setValue(SHOW_TOOLBARS, true);
|
||||||
if (!settings->contains(QUICK_NAVI_MODE))
|
if (!settings->contains(QUICK_NAVI_MODE))
|
||||||
|
@ -69,8 +69,6 @@ public:
|
|||||||
|
|
||||||
QColor getBackgroundColor() { return settings->value(BACKGROUND_COLOR).value<QColor>(); }
|
QColor getBackgroundColor() { return settings->value(BACKGROUND_COLOR).value<QColor>(); }
|
||||||
void setBackgroundColor(const QColor &color) { settings->value(BACKGROUND_COLOR, color); }
|
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(); }
|
bool getShowToolbars() { return settings->value(SHOW_TOOLBARS).toBool(); }
|
||||||
void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); }
|
void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); }
|
||||||
bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); }
|
bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); }
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
#endif*/
|
#endif*/
|
||||||
|
|
||||||
MainWindowViewer::MainWindowViewer()
|
MainWindowViewer::MainWindowViewer()
|
||||||
: QMainWindow(), fullscreen(false), toolbars(true), alwaysOnTop(false), currentDirectory("."), currentDirectoryImgDest("."), isClient(false)
|
: QMainWindow(), fullscreen(false), toolbars(true), currentDirectory("."), currentDirectoryImgDest("."), isClient(false)
|
||||||
{
|
{
|
||||||
loadConfiguration();
|
loadConfiguration();
|
||||||
setupUI();
|
setupUI();
|
||||||
@ -118,7 +118,6 @@ MainWindowViewer::~MainWindowViewer()
|
|||||||
delete showInfoAction;
|
delete showInfoAction;
|
||||||
delete closeAction;
|
delete closeAction;
|
||||||
delete showDictionaryAction;
|
delete showDictionaryAction;
|
||||||
delete alwaysOnTopAction;
|
|
||||||
delete adjustToFullSizeAction;
|
delete adjustToFullSizeAction;
|
||||||
delete fitToPageAction;
|
delete fitToPageAction;
|
||||||
delete showFlowAction;
|
delete showFlowAction;
|
||||||
@ -189,11 +188,6 @@ void MainWindowViewer::setupUI()
|
|||||||
|
|
||||||
viewer->setFocusPolicy(Qt::StrongFocus);
|
viewer->setFocusPolicy(Qt::StrongFocus);
|
||||||
|
|
||||||
// if(Configuration::getConfiguration().getAlwaysOnTop())
|
|
||||||
//{
|
|
||||||
// setWindowFlags(this->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);
|
|
||||||
// }
|
|
||||||
|
|
||||||
previousWindowFlags = windowFlags();
|
previousWindowFlags = windowFlags();
|
||||||
previousPos = pos();
|
previousPos = pos();
|
||||||
previousSize = size();
|
previousSize = size();
|
||||||
@ -485,16 +479,6 @@ void MainWindowViewer::createActions()
|
|||||||
showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y));
|
showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y));
|
||||||
connect(showDictionaryAction, &QAction::triggered, viewer, &Viewer::translatorSwitch);
|
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 = new QAction(tr("Show go to flow"), this);
|
||||||
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png"));
|
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.png"));
|
||||||
showFlowAction->setData(SHOW_FLOW_ACTION_Y);
|
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()
|
void MainWindowViewer::adjustToFullSizeSwitch()
|
||||||
{
|
{
|
||||||
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullRes);
|
Configuration::getConfiguration().setFitMode(YACReader::FitMode::FullRes);
|
||||||
|
@ -59,7 +59,6 @@ public slots:
|
|||||||
void openComic(QString pathFile);
|
void openComic(QString pathFile);
|
||||||
void openFolderFromPath(QString pathDir);
|
void openFolderFromPath(QString pathDir);
|
||||||
void openFolderFromPath(QString pathFile, QString atFileName);
|
void openFolderFromPath(QString pathFile, QString atFileName);
|
||||||
void alwaysOnTopSwitch();
|
|
||||||
void adjustToFullSizeSwitch();
|
void adjustToFullSizeSwitch();
|
||||||
void fitToPageSwitch();
|
void fitToPageSwitch();
|
||||||
void resetZoomLevel();
|
void resetZoomLevel();
|
||||||
@ -85,7 +84,6 @@ private:
|
|||||||
//! State
|
//! State
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool toolbars;
|
bool toolbars;
|
||||||
bool alwaysOnTop;
|
|
||||||
bool fromMaximized;
|
bool fromMaximized;
|
||||||
|
|
||||||
// QTBUG-41883
|
// QTBUG-41883
|
||||||
@ -139,7 +137,6 @@ private:
|
|||||||
QAction *doubleMangaPageAction;
|
QAction *doubleMangaPageAction;
|
||||||
QAction *showShorcutsAction;
|
QAction *showShorcutsAction;
|
||||||
QAction *showDictionaryAction;
|
QAction *showDictionaryAction;
|
||||||
QAction *alwaysOnTopAction;
|
|
||||||
QAction *adjustToFullSizeAction;
|
QAction *adjustToFullSizeAction;
|
||||||
QAction *fitToPageAction;
|
QAction *fitToPageAction;
|
||||||
QAction *resetZoomAction;
|
QAction *resetZoomAction;
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE"
|
#define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE"
|
||||||
#define COVER_IS_SP "COVER_IS_SP"
|
#define COVER_IS_SP "COVER_IS_SP"
|
||||||
#define BACKGROUND_COLOR "BACKGROUND_COLOR"
|
#define BACKGROUND_COLOR "BACKGROUND_COLOR"
|
||||||
#define ALWAYS_ON_TOP "ALWAYS_ON_TOP"
|
|
||||||
#define SHOW_TOOLBARS "SHOW_TOOLBARS"
|
#define SHOW_TOOLBARS "SHOW_TOOLBARS"
|
||||||
#define BRIGHTNESS "BRIGHTNESS"
|
#define BRIGHTNESS "BRIGHTNESS"
|
||||||
#define CONTRAST "CONTRAST"
|
#define CONTRAST "CONTRAST"
|
||||||
|
@ -52,7 +52,6 @@ void ShortcutsManager::initDefaultShorcuts()
|
|||||||
defaultShorcuts.insert(SHOW_INFO_ACTION_Y, Qt::Key_I);
|
defaultShorcuts.insert(SHOW_INFO_ACTION_Y, Qt::Key_I);
|
||||||
defaultShorcuts.insert(CLOSE_ACTION_Y, Qt::Key_Escape);
|
defaultShorcuts.insert(CLOSE_ACTION_Y, Qt::Key_Escape);
|
||||||
defaultShorcuts.insert(SHOW_DICTIONARY_ACTION_Y, Qt::Key_T);
|
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(ADJUST_TO_FULL_SIZE_ACTION_Y, Qt::Key_W);
|
||||||
defaultShorcuts.insert(SHOW_FLOW_ACTION_Y, Qt::Key_S);
|
defaultShorcuts.insert(SHOW_FLOW_ACTION_Y, Qt::Key_S);
|
||||||
defaultShorcuts.insert(ZOOM_PLUS_ACTION_Y, Qt::Key_Plus);
|
defaultShorcuts.insert(ZOOM_PLUS_ACTION_Y, Qt::Key_Plus);
|
||||||
|
@ -116,7 +116,6 @@ public:
|
|||||||
#define SHOW_INFO_ACTION_Y "SHOW_INFO_ACTION_Y"
|
#define SHOW_INFO_ACTION_Y "SHOW_INFO_ACTION_Y"
|
||||||
#define CLOSE_ACTION_Y "CLOSE_ACTION_Y"
|
#define CLOSE_ACTION_Y "CLOSE_ACTION_Y"
|
||||||
#define SHOW_DICTIONARY_ACTION_Y "SHOW_DICTIONARY_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 ADJUST_TO_FULL_SIZE_ACTION_Y "ADJUST_TO_FULL_SIZE_ACTION_Y"
|
||||||
#define FIT_TO_PAGE_ACTION_Y "FIT_TO_PAGE_ACTION_Y"
|
#define FIT_TO_PAGE_ACTION_Y "FIT_TO_PAGE_ACTION_Y"
|
||||||
#define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y"
|
#define SHOW_FLOW_ACTION_Y "SHOW_FLOW_ACTION_Y"
|
||||||
|
Loading…
Reference in New Issue
Block a user