feat: make initialize ui more human-friendly

This commit is contained in:
YiFang Xiao 2023-06-10 13:36:23 +08:00
parent 9c1a77a3f8
commit 90b89acac0
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-downarrow.png</file>
<file>icons/custom_trans.svg</file>
<file>icons/splash.png</file>
</qresource>
</RCC>

View file

@ -8,6 +8,7 @@
Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( parent )
{
ui.setupUi( this );
setWindowFlags( Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
Qt::WindowMinimizeButtonHint );
@ -28,7 +29,7 @@ Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( par
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->show();
ui.progressBar->show();

View file

@ -1,65 +1,133 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Initializing</class>
<widget class="QDialog" name="Initializing" >
<property name="windowModality" >
<widget class="QDialog" name="Initializing">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry" >
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>326</width>
<height>84</height>
<width>680</width>
<height>422</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>326</width>
<height>0</height>
<width>680</width>
<height>422</height>
</size>
</property>
<property name="windowTitle" >
<property name="maximumSize">
<size>
<width>680</width>
<height>422</height>
</size>
</property>
<property name="windowTitle">
<string>GoldenDict-ng - Initializing</string>
</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="operation" >
<property name="text" >
<string>Please wait while indexing dictionary</string>
<widget class="QLabel" name="splashImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
<property name="maximumSize">
<size>
<width>680</width>
<height>382</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dictionary" >
<property name="font" >
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Dictionary Name</string>
</property>
<property name="scaledContents" >
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<property name="pixmap">
<pixmap resource="../../resources.qrc">:/icons/splash.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar" >
<property name="maximum" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="operation">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Indexing...</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dictionary">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Dictionary Name</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="maximum">
<number>0</number>
</property>
<property name="value" >
<property name="value">
<number>-1</number>
</property>
<property name="alignment">
@ -69,6 +137,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../resources.qrc"/>
</resources>
<connections/>
</ui>