Skip to content

Commit

Permalink
更换默认背景,增加按钮控制UI显示
Browse files Browse the repository at this point in the history
  • Loading branch information
GengGode committed Sep 18, 2021
1 parent cc00bd8 commit 3b48a33
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
23 changes: 23 additions & 0 deletions GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ GenshinImpactNaturalLaw::GenshinImpactNaturalLaw(QWidget *parent)
connect(ui.pushButton_StartGame, SIGNAL(clicked()), this, SLOT(StartGame()));

connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(OpenPageLinkeUrl()));

connect(ui.pushButton_Linke_7temp, SIGNAL(clicked()), this, SLOT(ChangedUIShowSate()));
}
GenshinImpactNaturalLaw::~GenshinImpactNaturalLaw()
{
Expand Down Expand Up @@ -300,6 +302,27 @@ void GenshinImpactNaturalLaw::OpenButtonLabelLinkeUrl()
}
}
}
void GenshinImpactNaturalLaw::ChangedUIShowSate()
{
static bool nowIsShowState = true;

if (nowIsShowState)
{
ui.GrayBackGround_TabPage_Rect->hide();
ui.pushButton->hide();
ui.label_Page_Rect->hide();
ui.tabWidget->hide();
}
else
{
ui.GrayBackGround_TabPage_Rect->show();
ui.pushButton->show();
ui.label_Page_Rect->show();
ui.tabWidget->show();

}
nowIsShowState = !nowIsShowState;
}
void GenshinImpactNaturalLaw::TrayMenuClickEvent(QSystemTrayIcon::ActivationReason reason)
{
switch (reason)
Expand Down
2 changes: 2 additions & 0 deletions GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private slots:
void OpenLinkeUrl();
void OpenPageLinkeUrl();
void OpenButtonLabelLinkeUrl();

void ChangedUIShowSate();

void TrayMenuClickEvent(QSystemTrayIcon::ActivationReason reason);
// Receive Setting From WidgetsSetting
Expand Down
34 changes: 34 additions & 0 deletions GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.ui
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<property name="pixmap">
<pixmap resource="GenshinImpactNaturalLaw.qrc">:/BackgroundImage/resource/bg.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="TitleLabelRect">
<property name="geometry">
Expand Down Expand Up @@ -764,6 +767,36 @@ font-size:12;</string>
<string>2.0.0</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_Linke_7temp">
<property name="geometry">
<rect>
<x>1232</x>
<y>680</y>
<width>40</width>
<height>40</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
background-color:rgba(0,0,0,120);
color:rgb(255, 255, 255);
border:rgb(82, 92, 115);
border-radius:20px;
}
QPushButton:hover {
border:2px solid rgb(255, 210, 132);
}
QPushButton:pressed {
border:2px solid rgb(255, 210, 132);
}</string>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>MainBackgroundImageRect</zorder>
<zorder>TitleLabelRect</zorder>
<zorder>pushButton_StartGame</zorder>
Expand All @@ -782,6 +815,7 @@ font-size:12;</string>
<zorder>pushButton</zorder>
<zorder>pushButton_Linke_6</zorder>
<zorder>TitleLabelVersion</zorder>
<zorder>pushButton_Linke_7temp</zorder>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
Expand Down
Binary file modified GenshinImpactNaturalLaw/resource/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b48a33

Please sign in to comment.