主导航改用StackedWidget
parent
6a4a724f00
commit
526f33ceba
|
@ -104,10 +104,10 @@
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="ElementPoolWidget.cpp" />
|
|
||||||
<ClCompile Include="src\CaptionButton.cpp" />
|
<ClCompile Include="src\CaptionButton.cpp" />
|
||||||
<ClCompile Include="src\Editor\EditorWidget.cpp" />
|
<ClCompile Include="src\Editor\EditorWidget.cpp" />
|
||||||
<ClCompile Include="src\Editor\ElementManager.cpp" />
|
<ClCompile Include="src\Editor\ElementManager.cpp" />
|
||||||
|
<ClCompile Include="src\Editor\ElementPoolWidget.cpp" />
|
||||||
<ClCompile Include="src\Editor\GraphicElement.cpp" />
|
<ClCompile Include="src\Editor\GraphicElement.cpp" />
|
||||||
<ClCompile Include="src\Editor\LayerManager.cpp" />
|
<ClCompile Include="src\Editor\LayerManager.cpp" />
|
||||||
<ClCompile Include="src\Editor\LayerStyle.cpp" />
|
<ClCompile Include="src\Editor\LayerStyle.cpp" />
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
<ClCompile Include="src\Editor\PixelPath.cpp">
|
<ClCompile Include="src\Editor\PixelPath.cpp">
|
||||||
<Filter>Source Files\Editor</Filter>
|
<Filter>Source Files\Editor</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="ElementPoolWidget.cpp">
|
<ClCompile Include="src\Editor\ElementPoolWidget.cpp">
|
||||||
<Filter>Source Files\Editor</Filter>
|
<Filter>Source Files\Editor</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -40,66 +40,20 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="1">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<property name="topMargin">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<number>0</number>
|
||||||
<property name="font">
|
</property>
|
||||||
<font>
|
<property name="spacing">
|
||||||
<family>Segoe UI, Microsoft YaHei UI</family>
|
<number>0</number>
|
||||||
<pointsize>10</pointsize>
|
</property>
|
||||||
<weight>50</weight>
|
<item row="0" column="0">
|
||||||
<italic>false</italic>
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<bold>false</bold>
|
<widget class="EditorWidget" name="editorWidget"/>
|
||||||
</font>
|
<widget class="Renderer::RendererWidget" name="rendererWidget"/>
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">
|
|
||||||
QTabBar::tab {
|
|
||||||
height: 0px;
|
|
||||||
margin-top:0px;
|
|
||||||
}
|
|
||||||
QTabWidget::tab-bar
|
|
||||||
{
|
|
||||||
height: 0px;
|
|
||||||
top:0px;
|
|
||||||
}
|
|
||||||
QTabWidget::pane {
|
|
||||||
border: 0px;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="tabPosition">
|
|
||||||
<enum>QTabWidget::North</enum>
|
|
||||||
</property>
|
|
||||||
<property name="tabShape">
|
|
||||||
<enum>QTabWidget::Rounded</enum>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="elideMode">
|
|
||||||
<enum>Qt::ElideNone</enum>
|
|
||||||
</property>
|
|
||||||
<property name="tabsClosable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="EditorWidget" name="editorWidget">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>纹理编辑</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
<widget class="Renderer::RendererWidget" name="rendererWidget">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>场景渲染</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -15,14 +15,9 @@ CentralWidget::CentralWidget(QWidget* parent) : QMainWindow(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
NavigationBarWidget* navigationBarWidget = new NavigationBarWidget();
|
NavigationBarWidget* navigationBarWidget = new NavigationBarWidget();
|
||||||
|
ui.gridLayout->addWidget(navigationBarWidget, 0, 0, 1, 1, Qt::AlignTop | Qt::AlignHCenter);
|
||||||
QHBoxLayout* tabBarLayout = new QHBoxLayout(ui.tabWidget);
|
QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.stackedWidget, &QStackedWidget::setCurrentIndex);
|
||||||
tabBarLayout->setSpacing(0);
|
QObject::connect(ui.stackedWidget, &QStackedWidget::currentChanged,
|
||||||
tabBarLayout->setMargin(0);
|
|
||||||
tabBarLayout->addWidget(navigationBarWidget, 0, Qt::AlignTop | Qt::AlignHCenter);
|
|
||||||
|
|
||||||
QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.tabWidget, &QTabWidget::setCurrentIndex);
|
|
||||||
QObject::connect(ui.tabWidget, &QTabWidget::currentChanged,
|
|
||||||
ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged);
|
ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +36,7 @@ MainWindow::MainWindow(QWidget* parent, const Qt::WindowFlags flags)
|
||||||
m_titleBar->maximizeButton()->setFixedHeight(kTitleBarHeight);
|
m_titleBar->maximizeButton()->setFixedHeight(kTitleBarHeight);
|
||||||
m_titleBar->closeButton()->setFixedHeight(kTitleBarHeight);
|
m_titleBar->closeButton()->setFixedHeight(kTitleBarHeight);
|
||||||
m_titleBar->setTitleFont(QFont(QString("Segoe UI, Microsoft YaHei UI"), 10));
|
m_titleBar->setTitleFont(QFont(QString("Segoe UI, Microsoft YaHei UI"), 10));
|
||||||
m_titleBar->chromePalette()->setTitleBarActiveBackgroundColor(QColor(0,0,0,0));
|
m_titleBar->chromePalette()->setTitleBarActiveBackgroundColor(QColor(0, 0, 0, 0));
|
||||||
m_titleBar->chromePalette()->setTitleBarInactiveBackgroundColor(QColor(0, 0, 0, 0));
|
m_titleBar->chromePalette()->setTitleBarInactiveBackgroundColor(QColor(0, 0, 0, 0));
|
||||||
|
|
||||||
m_central_widget = new CentralWidget();
|
m_central_widget = new CentralWidget();
|
||||||
|
|
Loading…
Reference in New Issue