mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-17 23:04:06 +00:00
Merge pull request #1574 from xiaoyifang/opt/remove-custom-qt-style
opt: remove currentGroup qt style property
This commit is contained in:
commit
7b7c40271c
|
@ -1606,8 +1606,6 @@ void MainWindow::updateGroupList()
|
|||
groupList->fill( groupInstances );
|
||||
groupList->setCurrentGroup( cfg.lastMainGroupId );
|
||||
|
||||
updateCurrentGroupProperty();
|
||||
|
||||
updateDictionaryBar();
|
||||
|
||||
qDebug() << "Reloading all the tabs...";
|
||||
|
@ -2315,30 +2313,10 @@ void MainWindow::currentGroupChanged( int )
|
|||
}
|
||||
}
|
||||
|
||||
updateCurrentGroupProperty();
|
||||
|
||||
if ( ftsDlg )
|
||||
ftsDlg->setCurrentGroup( grg_id );
|
||||
}
|
||||
|
||||
void MainWindow::updateCurrentGroupProperty()
|
||||
{
|
||||
// We maintain currentGroup property so styles could use that to change
|
||||
// fonts based on group names
|
||||
Instances::Group * grp = groupInstances.findGroup( groupList->getCurrentGroup() );
|
||||
|
||||
if ( grp && translateLine->property( "currentGroup" ).toString() != grp->name ) {
|
||||
translateLine->setProperty( "currentGroup", grp->name );
|
||||
ui.wordList->setProperty( "currentGroup", grp->name );
|
||||
QString ss = styleSheet();
|
||||
|
||||
// Only update stylesheet if it mentions currentGroup, as updating the
|
||||
// stylesheet is a slow operation
|
||||
if ( ss.contains( "currentGroup" ) )
|
||||
setStyleSheet( ss );
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::translateInputChanged( QString const & newValue )
|
||||
{
|
||||
updateSuggestionList( newValue );
|
||||
|
|
|
@ -235,8 +235,6 @@ private:
|
|||
|
||||
void mousePressEvent( QMouseEvent * event );
|
||||
|
||||
void updateCurrentGroupProperty();
|
||||
|
||||
|
||||
/// Handles backward and forward mouse buttons and
|
||||
/// returns true if the event is handled.
|
||||
|
|
Loading…
Reference in a new issue