Skip to content

Commit

Permalink
fix ui
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn>
  • Loading branch information
QQxiaoming committed Sep 10, 2024
1 parent 2ff6e7b commit f40e4dd
Show file tree
Hide file tree
Showing 21 changed files with 191 additions and 142 deletions.
9 changes: 6 additions & 3 deletions src/globaloptions/globaloptionsadvancedwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>449</width>
<height>459</height>
<width>440</width>
<height>500</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -272,10 +272,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>275</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
7 changes: 5 additions & 2 deletions src/globaloptions/globaloptionsappearancewidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>550</width>
<height>598</height>
<height>538</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -720,10 +720,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
9 changes: 6 additions & 3 deletions src/globaloptions/globaloptionsgeneralwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>379</width>
<height>412</height>
<width>440</width>
<height>500</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
Expand Down Expand Up @@ -293,10 +293,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
9 changes: 6 additions & 3 deletions src/globaloptions/globaloptionsterminalwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>434</width>
<height>497</height>
<width>440</width>
<height>518</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -213,10 +213,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
9 changes: 6 additions & 3 deletions src/globaloptions/globaloptionstransferwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>420</width>
<height>300</height>
<width>440</width>
<height>500</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -175,10 +175,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
41 changes: 18 additions & 23 deletions src/globaloptions/globaloptionswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,26 @@ GlobalOptionsWindow::GlobalOptionsWindow(QWidget *parent) :
model->setDistinguishType(false);
treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
splitter->addWidget(treeView);
QWidget *widget = new QWidget(this);
splitter->addWidget(widget);
widget->setLayout(new QVBoxLayout(widget));
widget->layout()->setContentsMargins(0,0,0,0);
stackedWidget = new QStackedWidget(this);
emptyWidget = new QWidget(this);
stackedWidget->addWidget(emptyWidget);
splitter->addWidget(stackedWidget);
splitter->setSizes(QList<int>() << 1 << 100);
splitter->setCollapsible(0,false);
splitter->setCollapsible(1,false);

globalOptionsGeneralWidget = new GlobalOptionsGeneralWidget(widget);
widget->layout()->addWidget(globalOptionsGeneralWidget);
globalOptionsAppearanceWidget = new GlobalOptionsAppearanceWidget(widget);
widget->layout()->addWidget(globalOptionsAppearanceWidget);
globalOptionsTerminalWidget = new GlobalOptionsTerminalWidget(widget);
widget->layout()->addWidget(globalOptionsTerminalWidget);
globalOptionsWindowWidget = new GlobalOptionsWindowWidget(widget);
widget->layout()->addWidget(globalOptionsWindowWidget);
globalOptionsTransferWidget = new GlobalOptionsTransferWidget(widget);
widget->layout()->addWidget(globalOptionsTransferWidget);
globalOptionsAdvancedWidget = new GlobalOptionsAdvancedWidget(widget);
widget->layout()->addWidget(globalOptionsAdvancedWidget);
globalOptionsGeneralWidget = new GlobalOptionsGeneralWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsGeneralWidget);
globalOptionsAppearanceWidget = new GlobalOptionsAppearanceWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsAppearanceWidget);
globalOptionsTerminalWidget = new GlobalOptionsTerminalWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsTerminalWidget);
globalOptionsWindowWidget = new GlobalOptionsWindowWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsWindowWidget);
globalOptionsTransferWidget = new GlobalOptionsTransferWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsTransferWidget);
globalOptionsAdvancedWidget = new GlobalOptionsAdvancedWidget(stackedWidget);
stackedWidget->addWidget(globalOptionsAdvancedWidget);

treeView->setModel(model);
retranslateUi();
Expand Down Expand Up @@ -490,15 +490,10 @@ void GlobalOptionsWindow::retranslateUi()

void GlobalOptionsWindow::setActiveWidget(QWidget *widget)
{
globalOptionsGeneralWidget->setVisible(false);
globalOptionsAppearanceWidget->setVisible(false);
globalOptionsTerminalWidget->setVisible(false);
globalOptionsWindowWidget->setVisible(false);
globalOptionsTransferWidget->setVisible(false);
globalOptionsAdvancedWidget->setVisible(false);
stackedWidget->setCurrentWidget(emptyWidget);

if(widget)
widget->setVisible(true);
stackedWidget->setCurrentWidget(widget);
}

void GlobalOptionsWindow::setAvailableColorSchemes(QStringList colorSchemes)
Expand Down
4 changes: 4 additions & 0 deletions src/globaloptions/globaloptionswindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <QColor>
#include <QTreeView>
#include <QList>
#include <QStackedWidget>

#include "globaloptionsgeneralwidget.h"
#include "globaloptionsappearancewidget.h"
#include "globaloptionsterminalwidget.h"
Expand Down Expand Up @@ -148,6 +150,8 @@ private slots:

private:
Ui::GlobalOptionsWindow *ui;
QStackedWidget *stackedWidget;
QWidget *emptyWidget;
GlobalOptionsGeneralWidget *globalOptionsGeneralWidget;
GlobalOptionsAppearanceWidget *globalOptionsAppearanceWidget;
GlobalOptionsTerminalWidget *globalOptionsTerminalWidget;
Expand Down
4 changes: 2 additions & 2 deletions src/globaloptions/globaloptionswindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>726</width>
<height>299</height>
<width>730</width>
<height>550</height>
</rect>
</property>
<property name="windowTitle">
Expand Down
9 changes: 6 additions & 3 deletions src/globaloptions/globaloptionswindowwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>440</width>
<height>500</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -45,10 +45,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
93 changes: 53 additions & 40 deletions src/sessionoptions/sessionoptionsgeneralwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
Expand Down Expand Up @@ -56,46 +53,59 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxProtocol">
<item>
<property name="text">
<string notr="true">Telnet</string>
</property>
</item>
<item>
<property name="text">
<string>Serial</string>
</property>
</item>
<item>
<property name="text">
<string>Local Shell</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Raw</string>
</property>
</item>
<item>
<property name="text">
<string>Named Pipe</string>
</property>
</item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<property name="text">
<string notr="true">SSH2</string>
</property>
<widget class="QComboBox" name="comboBoxProtocol">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string notr="true">Telnet</string>
</property>
</item>
<item>
<property name="text">
<string>Serial</string>
</property>
</item>
<item>
<property name="text">
<string>Local Shell</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Raw</string>
</property>
</item>
<item>
<property name="text">
<string>Named Pipe</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">SSH2</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">VNC</string>
</property>
</item>
</widget>
</item>
<item>
<property name="text">
<string notr="true">VNC</string>
</property>
<widget class="QLineEdit" name="lineEditReadOnlyProtocol"/>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditReadOnlyProtocol"/>
</layout>
</item>
</layout>
</item>
Expand All @@ -104,10 +114,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>233</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
5 changes: 4 additions & 1 deletion src/sessionoptions/sessionoptionslocalshellproperties.ui
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
4 changes: 2 additions & 2 deletions src/sessionoptions/sessionoptionslocalshellstate.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>356</width>
<height>216</height>
<width>400</width>
<height>300</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down
Loading

0 comments on commit f40e4dd

Please sign in to comment.