Merge pull request #843 from xiaoyifang/feature/splash-2

feat: make initialize ui more human-friendly
This commit is contained in:
xiaoyifang 2023-06-10 18:25:48 +08:00 committed by GitHub
commit a688a08eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 37 deletions

BIN
icons/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View file

@ -89,5 +89,6 @@
<file>icons/old-arrow.png</file> <file>icons/old-arrow.png</file>
<file>icons/old-downarrow.png</file> <file>icons/old-downarrow.png</file>
<file>icons/custom_trans.svg</file> <file>icons/custom_trans.svg</file>
<file>icons/splash.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -8,6 +8,7 @@
Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( parent ) Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( parent )
{ {
ui.setupUi( this ); ui.setupUi( this );
setWindowFlags( Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | setWindowFlags( Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
Qt::WindowMinimizeButtonHint ); Qt::WindowMinimizeButtonHint );
@ -28,7 +29,7 @@ Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( par
void Initializing::indexing( QString const & dictionaryName ) void Initializing::indexing( QString const & dictionaryName )
{ {
ui.operation->setText( tr( "Please wait while indexing dictionary" ) ); ui.operation->setText( tr( "Indexing..." ) );
ui.dictionary->setText( dictionaryName ); ui.dictionary->setText( dictionaryName );
ui.dictionary->show(); ui.dictionary->show();
ui.progressBar->show(); ui.progressBar->show();

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Initializing</class> <class>Initializing</class>
<widget class="QDialog" name="Initializing"> <widget class="QDialog" name="Initializing">
@ -8,24 +9,87 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>326</width> <width>680</width>
<height>84</height> <height>422</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>326</width> <width>680</width>
<height>0</height> <height>422</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>680</width>
<height>422</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>GoldenDict-ng - Initializing</string> <string>GoldenDict-ng - Initializing</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="splashImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>680</width>
<height>382</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../resources.qrc">:/icons/splash.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="operation"> <widget class="QLabel" name="operation">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Please wait while indexing dictionary</string> <string>Indexing...</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -34,18 +98,20 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="dictionary"> <widget class="QLabel" name="dictionary">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Dictionary Name</string> <string>Dictionary Name</string>
</property> </property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
@ -54,6 +120,8 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item> <item>
<widget class="QProgressBar" name="progressBar"> <widget class="QProgressBar" name="progressBar">
<property name="maximum"> <property name="maximum">
@ -69,6 +137,8 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../../resources.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>