New feature: Always keep on top.
This commit is contained in:
parent
9178456a9f
commit
bf4942e316
|
@ -53,6 +53,7 @@
|
|||
- Shortcuts manager.
|
||||
- Support for custom known measurements.
|
||||
- Allow negative values.
|
||||
- Tape app. New feature: Always keep on top.
|
||||
|
||||
# Valentina 0.7.52 September 12, 2022
|
||||
- Fix crash when default locale is ru.
|
||||
|
|
|
@ -2129,6 +2129,10 @@ void TKMMainWindow::CreateWindowMenu(QMenu *menu)
|
|||
QAction *action = menu->addAction(tr("&New Window"));
|
||||
connect(action, &QAction::triggered, this, []() { MApplication::VApp()->NewMainKMWindow()->activateWindow(); });
|
||||
action->setMenuRole(QAction::NoRole);
|
||||
|
||||
menu->addAction(ui->actionAlwaysOnTop);
|
||||
connect(ui->actionAlwaysOnTop, &QAction::triggered, this, &TKMMainWindow::AlwaysOnTop);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
const QList<TKMMainWindow *> windows = MApplication::VApp()->MainKMWindows();
|
||||
|
|
|
@ -1203,6 +1203,20 @@
|
|||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAlwaysOnTop">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Always on top</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Keep window always on top</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -4227,6 +4227,10 @@ void TMainWindow::CreateWindowMenu(QMenu *menu)
|
|||
QAction *action = menu->addAction(tr("&New Window"));
|
||||
connect(action, &QAction::triggered, this, []() { MApplication::VApp()->NewMainTapeWindow()->activateWindow(); });
|
||||
action->setMenuRole(QAction::NoRole);
|
||||
|
||||
menu->addAction(ui->actionAlwaysOnTop);
|
||||
connect(ui->actionAlwaysOnTop, &QAction::triggered, this, &TMainWindow::AlwaysOnTop);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
const QList<TMainWindow *> windows = MApplication::VApp()->MainTapeWindows();
|
||||
|
|
|
@ -1726,6 +1726,20 @@
|
|||
<string>Edit current Known Measurements</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAlwaysOnTop">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Always on top</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Keep window always on top</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
|
|
@ -411,6 +411,15 @@ void VAbstractMainWindow::ExportDataToCSV()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractMainWindow::AlwaysOnTop(bool state)
|
||||
{
|
||||
setWindowFlag(Qt::WindowStaysOnTopHint, state);
|
||||
destroy();
|
||||
create();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractMainWindow::UpdateVisibilityGroups()
|
||||
{
|
||||
|
|
|
@ -61,6 +61,7 @@ public slots:
|
|||
|
||||
protected slots:
|
||||
void ExportDataToCSV();
|
||||
void AlwaysOnTop(bool state);
|
||||
|
||||
protected:
|
||||
unsigned m_curFileFormatVersion;
|
||||
|
|
Loading…
Reference in New Issue
Block a user