mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
opt: group widget remove all tabs (#892)
* opt: remove all group widget tabs * 🎨 apply clang-format changes * opt: does not elide text on tab name * 🎨 apply clang-format changes --------- Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
This commit is contained in:
parent
04a58d6418
commit
ef594117c3
|
@ -126,7 +126,7 @@
|
|||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideRight</enum>
|
||||
<enum>Qt::ElideNone</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
|
|
|
@ -551,6 +551,9 @@ DictGroupsWidget::DictGroupsWidget( QWidget * parent ):
|
|||
setMovable( true );
|
||||
setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( this, &QWidget::customContextMenuRequested, this, &DictGroupsWidget::contextMenu );
|
||||
|
||||
setElideMode( Qt::ElideNone );
|
||||
setUsesScrollButtons( true );
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -575,8 +578,7 @@ void DictGroupsWidget::populate( Config::Groups const & groups,
|
|||
vector< sptr< Dictionary::Class > > const & allDicts_,
|
||||
vector< sptr< Dictionary::Class > > const & activeDicts_ )
|
||||
{
|
||||
while( count() )
|
||||
removeCurrentGroup();
|
||||
removeAllGroups();
|
||||
|
||||
allDicts = &allDicts_;
|
||||
activeDicts = &activeDicts_;
|
||||
|
@ -597,8 +599,6 @@ void DictGroupsWidget::populate( Config::Groups const & groups,
|
|||
nextId = groups.nextId;
|
||||
|
||||
setCurrentIndex( 0 );
|
||||
|
||||
setUsesScrollButtons( count() > 3 );
|
||||
}
|
||||
|
||||
/// Creates groups from what is currently set up
|
||||
|
@ -666,8 +666,6 @@ void DictGroupsWidget::addNewGroup( QString const & name )
|
|||
QString toolTipStr = "\"" + tabText( idx ) + "\"\n" + tr( "Dictionaries: " )
|
||||
+ QString::number( getCurrentModel()->getCurrentDictionaries().size() );
|
||||
setTabToolTip( idx, toolTipStr );
|
||||
|
||||
setUsesScrollButtons( count() > 3 );
|
||||
}
|
||||
|
||||
int DictGroupsWidget::addUniqueGroup( const QString & name )
|
||||
|
@ -950,8 +948,6 @@ void DictGroupsWidget::removeCurrentGroup()
|
|||
removeTab( current );
|
||||
delete w;
|
||||
}
|
||||
|
||||
setUsesScrollButtons( count() > 3 );
|
||||
}
|
||||
|
||||
void DictGroupsWidget::removeAllGroups()
|
||||
|
|
Loading…
Reference in a new issue