mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
opt: remove currentGroup qt style property
This commit is contained in:
parent
73f525f61b
commit
9141a8f780
|
@ -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