clean code: remove uxtheme

This commit is contained in:
Xiao YiFang 2022-05-20 18:43:47 +08:00
parent 459b684e5b
commit 6cf1cf1200
5 changed files with 0 additions and 62 deletions

View file

@ -16,7 +16,6 @@
#include "initializing.hh" #include "initializing.hh"
#include <qt_windows.h> #include <qt_windows.h>
#include <uxtheme.h>
#include <QOperatingSystemVersion> #include <QOperatingSystemVersion>
#endif #endif
@ -242,27 +241,6 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent,
if( delegate ) if( delegate )
ui.headwordsView->setItemDelegate( delegate ); ui.headwordsView->setItemDelegate( delegate );
#if defined( Q_OS_WIN32 )
// Style "windowsvista" in Qt5 turn off progress bar animation for classic appearance
// We use simply "windows" style instead for this case
oldBarStyle = 0;
if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7
&& !IsThemeActive() )
{
QStyle * barStyle = WindowsStyle::instance().getStyle();
if( barStyle )
{
oldBarStyle = ui.searchProgressBar->style();
ui.searchProgressBar->setStyle( barStyle );
}
}
#endif
ui.searchLine->setText( static_cast< MainWindow * >( parent )->getTranslateLineText() ); ui.searchLine->setText( static_cast< MainWindow * >( parent )->getTranslateLineText() );
ui.searchLine->selectAll(); ui.searchLine->selectAll();
} }
@ -271,13 +249,6 @@ FullTextSearchDialog::~FullTextSearchDialog()
{ {
if( delegate ) if( delegate )
delegate->deleteLater(); delegate->deleteLater();
#if defined( Q_OS_WIN32 )
if( oldBarStyle )
ui.searchProgressBar->setStyle( oldBarStyle );
#endif
} }
void FullTextSearchDialog::stopSearch() void FullTextSearchDialog::stopSearch()

View file

@ -188,10 +188,6 @@ class FullTextSearchDialog : public QDialog
QRegExp searchRegExp; QRegExp searchRegExp;
#if defined( Q_OS_WIN32 )
QStyle * oldBarStyle;
#endif
public: public:
FullTextSearchDialog( QWidget * parent, FullTextSearchDialog( QWidget * parent,
Config::Class & cfg_, Config::Class & cfg_,

View file

@ -119,8 +119,6 @@ win32 {
!CONFIG( no_chinese_conversion_support ) { !CONFIG( no_chinese_conversion_support ) {
CONFIG += chinese_conversion_support CONFIG += chinese_conversion_support
} }
LIBS += -luxtheme
} }
unix:!mac { unix:!mac {

View file

@ -7,7 +7,6 @@
#if defined( Q_OS_WIN32 ) #if defined( Q_OS_WIN32 )
#include <qt_windows.h> #include <qt_windows.h>
#include <uxtheme.h>
#include <QOperatingSystemVersion> #include <QOperatingSystemVersion>
WindowsStyle::WindowsStyle() WindowsStyle::WindowsStyle()
@ -35,27 +34,6 @@ Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( par
setWindowIcon( QIcon( ":/icons/macicon.png" ) ); setWindowIcon( QIcon( ":/icons/macicon.png" ) );
#endif #endif
#if defined( Q_OS_WIN32 )
// Style "windowsvista" in Qt5 turn off progress bar animation for classic appearance
// We use simply "windows" style instead for this case
oldBarStyle = 0;
if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7
&& !IsThemeActive() )
{
QStyle * barStyle = WindowsStyle::instance().getStyle();
if( barStyle )
{
oldBarStyle = ui.progressBar->style();
ui.progressBar->setStyle( barStyle );
}
}
#endif
if ( showOnStartup ) if ( showOnStartup )
{ {
ui.operation->setText( tr( "Please wait..." ) ); ui.operation->setText( tr( "Please wait..." ) );
@ -88,8 +66,6 @@ void Initializing::reject()
Initializing::~Initializing() Initializing::~Initializing()
{ {
if( oldBarStyle )
ui.progressBar->setStyle( oldBarStyle );
} }
#endif #endif

View file

@ -46,9 +46,6 @@ private:
virtual void closeEvent( QCloseEvent * ); virtual void closeEvent( QCloseEvent * );
virtual void reject(); virtual void reject();
#if defined( Q_OS_WIN32 )
QStyle * oldBarStyle;
#endif
Ui::Initializing ui; Ui::Initializing ui;
}; };