Some fixes.
This commit is contained in:
parent
03fda9f090
commit
b3e5a38f96
@ -184,27 +184,31 @@ void FormMain::switchMainMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormMain::switchVisibility(bool force_hide) {
|
void FormMain::switchVisibility(bool force_hide) {
|
||||||
// TODO: Kdyz neni povolena tray ikona, tak je povolena satle polozka "switch window" v menu.
|
|
||||||
// v pripade ze tedy neni povolena tray ikona, tak polozku switch bud disabnout
|
|
||||||
// nebo upravit jeji chovani aby provedla minimalizaci a ne hide.
|
|
||||||
// aktualne nastaveno na tu minimalizaci
|
|
||||||
if (force_hide || isVisible()) {
|
if (force_hide || isVisible()) {
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
m_ui->m_actionSwitchMainWindow->blockSignals(true);
|
|
||||||
m_ui->m_actionSwitchMainWindow->setChecked(false);
|
|
||||||
m_ui->m_actionSwitchMainWindow->blockSignals(false);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// Window gets minimized in single-window mode.
|
||||||
showMinimized();
|
showMinimized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
display();
|
display();
|
||||||
m_ui->m_actionSwitchMainWindow->blockSignals(true);
|
}
|
||||||
m_ui->m_actionSwitchMainWindow->setChecked(true);
|
}
|
||||||
m_ui->m_actionSwitchMainWindow->blockSignals(false);
|
|
||||||
|
void FormMain::setApplicationMode(FormMain::ApplicationMode mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case Tray:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SingleWindow:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +390,7 @@ void FormMain::createConnections() {
|
|||||||
// Menu "View" connections.
|
// Menu "View" connections.
|
||||||
connect(m_ui->m_actionFullscreen, SIGNAL(toggled(bool)), this, SLOT(switchFullscreenMode()));
|
connect(m_ui->m_actionFullscreen, SIGNAL(toggled(bool)), this, SLOT(switchFullscreenMode()));
|
||||||
connect(m_ui->m_actionSwitchMainMenu, SIGNAL(toggled(bool)), this, SLOT(switchMainMenu()));
|
connect(m_ui->m_actionSwitchMainMenu, SIGNAL(toggled(bool)), this, SLOT(switchMainMenu()));
|
||||||
connect(m_ui->m_actionSwitchMainWindow, SIGNAL(toggled(bool)), this, SLOT(switchVisibility()));
|
connect(m_ui->m_actionSwitchMainWindow, SIGNAL(triggered()), this, SLOT(switchVisibility()));
|
||||||
|
|
||||||
// Menu "Tools" connections.
|
// Menu "Tools" connections.
|
||||||
connect(m_ui->m_actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
|
connect(m_ui->m_actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
|
||||||
|
@ -35,6 +35,11 @@ class FormMain : public QMainWindow {
|
|||||||
friend class FeedsView;
|
friend class FeedsView;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
enum ApplicationMode {
|
||||||
|
SingleWindow,
|
||||||
|
Tray
|
||||||
|
};
|
||||||
|
|
||||||
// Constructors and destructors.
|
// Constructors and destructors.
|
||||||
explicit FormMain(QWidget *parent = 0);
|
explicit FormMain(QWidget *parent = 0);
|
||||||
virtual ~FormMain();
|
virtual ~FormMain();
|
||||||
@ -92,6 +97,8 @@ class FormMain : public QMainWindow {
|
|||||||
// Switches visibility of main window.
|
// Switches visibility of main window.
|
||||||
void switchVisibility(bool force_hide = false);
|
void switchVisibility(bool force_hide = false);
|
||||||
|
|
||||||
|
void setApplicationMode(ApplicationMode mode);
|
||||||
|
|
||||||
// Turns on/off fullscreen mode
|
// Turns on/off fullscreen mode
|
||||||
void switchFullscreenMode();
|
void switchFullscreenMode();
|
||||||
|
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
<addaction name="m_actionFullscreen"/>
|
<addaction name="m_actionFullscreen"/>
|
||||||
<addaction name="m_actionSwitchFeedsList"/>
|
<addaction name="m_actionSwitchFeedsList"/>
|
||||||
<addaction name="m_actionSwitchMainMenu"/>
|
<addaction name="m_actionSwitchMainMenu"/>
|
||||||
<addaction name="m_actionSwitchMainWindow"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="m_menuShowHide"/>
|
<addaction name="m_menuShowHide"/>
|
||||||
|
<addaction name="m_actionSwitchMainWindow"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="m_menuTools">
|
<widget class="QMenu" name="m_menuTools">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -367,14 +367,11 @@
|
|||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="m_actionSwitchMainWindow">
|
<action name="m_actionSwitchMainWindow">
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Main &window</string>
|
<string>Switch visibility of main &window</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Hides main window if it is visible and shows it if it is hidden.</string>
|
<string>Hides main window if it is visible and shows it if it is hidden.</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user