mirror of
https://github.com/leozide/leocad
synced 2025-01-29 20:34:50 +01:00
Added shortcut for closing the current tab.
This commit is contained in:
parent
ee6ef69ede
commit
40ad756348
4 changed files with 19 additions and 0 deletions
|
@ -997,6 +997,13 @@ lcCommand gCommands[LC_NUM_COMMANDS] =
|
||||||
QT_TRANSLATE_NOOP("Status", "Toggle fullscreen mode"),
|
QT_TRANSLATE_NOOP("Status", "Toggle fullscreen mode"),
|
||||||
QT_TRANSLATE_NOOP("Shortcut", "")
|
QT_TRANSLATE_NOOP("Shortcut", "")
|
||||||
},
|
},
|
||||||
|
// LC_VIEW_CLOSE_CURRENT_TAB
|
||||||
|
{
|
||||||
|
QT_TRANSLATE_NOOP("Action", "View.CloseCurrentTab"),
|
||||||
|
QT_TRANSLATE_NOOP("Menu", "Close &Tab"),
|
||||||
|
QT_TRANSLATE_NOOP("Status", "Close current tab"),
|
||||||
|
QT_TRANSLATE_NOOP("Shortcut", "Ctrl+W")
|
||||||
|
},
|
||||||
// LC_VIEW_SHADE_WIREFRAME
|
// LC_VIEW_SHADE_WIREFRAME
|
||||||
{
|
{
|
||||||
QT_TRANSLATE_NOOP("Action", "View.Shade.Wireframe"),
|
QT_TRANSLATE_NOOP("Action", "View.Shade.Wireframe"),
|
||||||
|
|
|
@ -152,6 +152,7 @@ enum lcCommandId
|
||||||
LC_VIEW_REMOVE_VIEW,
|
LC_VIEW_REMOVE_VIEW,
|
||||||
LC_VIEW_RESET_VIEWS,
|
LC_VIEW_RESET_VIEWS,
|
||||||
LC_VIEW_FULLSCREEN,
|
LC_VIEW_FULLSCREEN,
|
||||||
|
LC_VIEW_CLOSE_CURRENT_TAB,
|
||||||
LC_VIEW_SHADING_FIRST,
|
LC_VIEW_SHADING_FIRST,
|
||||||
LC_VIEW_SHADING_WIREFRAME = LC_VIEW_SHADING_FIRST,
|
LC_VIEW_SHADING_WIREFRAME = LC_VIEW_SHADING_FIRST,
|
||||||
LC_VIEW_SHADING_FLAT,
|
LC_VIEW_SHADING_FLAT,
|
||||||
|
|
|
@ -1406,6 +1406,12 @@ void lcMainWindow::RemoveAllModelTabs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lcMainWindow::CloseCurrentModelTab()
|
||||||
|
{
|
||||||
|
if (mModelTabWidget->count() > 1)
|
||||||
|
delete mModelTabWidget->currentWidget();
|
||||||
|
}
|
||||||
|
|
||||||
void lcMainWindow::SetCurrentModelTab(lcModel* Model)
|
void lcMainWindow::SetCurrentModelTab(lcModel* Model)
|
||||||
{
|
{
|
||||||
lcModelTabWidget* EmptyWidget = nullptr;
|
lcModelTabWidget* EmptyWidget = nullptr;
|
||||||
|
@ -2553,6 +2559,10 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
|
||||||
ToggleFullScreen();
|
ToggleFullScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LC_VIEW_CLOSE_CURRENT_TAB:
|
||||||
|
CloseCurrentModelTab();
|
||||||
|
break;
|
||||||
|
|
||||||
case LC_VIEW_SHADING_WIREFRAME:
|
case LC_VIEW_SHADING_WIREFRAME:
|
||||||
SetShadingMode(LC_SHADING_WIREFRAME);
|
SetShadingMode(LC_SHADING_WIREFRAME);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -253,6 +253,7 @@ public:
|
||||||
QByteArray GetTabLayout();
|
QByteArray GetTabLayout();
|
||||||
void RestoreTabLayout(const QByteArray& TabLayout);
|
void RestoreTabLayout(const QByteArray& TabLayout);
|
||||||
void RemoveAllModelTabs();
|
void RemoveAllModelTabs();
|
||||||
|
void CloseCurrentModelTab();
|
||||||
void SetCurrentModelTab(lcModel* Model);
|
void SetCurrentModelTab(lcModel* Model);
|
||||||
void ResetCameras();
|
void ResetCameras();
|
||||||
void AddView(View* View);
|
void AddView(View* View);
|
||||||
|
|
Loading…
Add table
Reference in a new issue