disable double middle click in playlist tabbar and activate elide mode
in sidebar
This commit is contained in:
parent
3c61fbdade
commit
d29aa81a3b
|
@ -94,18 +94,22 @@ void PlaylistTabBar::mouseReleaseEvent(QMouseEvent* e) {
|
|||
|
||||
void PlaylistTabBar::mouseDoubleClickEvent(QMouseEvent *e) {
|
||||
int index = tabAt(e->pos());
|
||||
if (index == -1) {
|
||||
new_->activate(QAction::Trigger);
|
||||
}
|
||||
else {
|
||||
//update current tab
|
||||
menu_index_ = index;
|
||||
|
||||
//set position
|
||||
rename_editor_->setGeometry(tabRect(index));
|
||||
rename_editor_->setText(tabText(index));
|
||||
rename_editor_->setVisible(true);
|
||||
rename_editor_->setFocus();
|
||||
//discard a double click with the middle button
|
||||
if (e->button() != Qt::MiddleButton) {
|
||||
if (index == -1) {
|
||||
new_->activate(QAction::Trigger);
|
||||
}
|
||||
else {
|
||||
//update current tab
|
||||
menu_index_ = index;
|
||||
|
||||
//set position
|
||||
rename_editor_->setGeometry(tabRect(index));
|
||||
rename_editor_->setText(tabText(index));
|
||||
rename_editor_->setVisible(true);
|
||||
rename_editor_->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
QTabBar::mouseDoubleClickEvent(e);
|
||||
|
|
|
@ -673,6 +673,7 @@ void FancyTabWidget::MakeTabBar(QTabBar::Shape shape, bool text, bool icons,
|
|||
bar->setShape(shape);
|
||||
bar->setDocumentMode(true);
|
||||
bar->setUsesScrollButtons(true);
|
||||
bar->setElideMode(Qt::ElideRight);
|
||||
|
||||
if (shape == QTabBar::RoundedWest) {
|
||||
bar->setIconSize(QSize(22, 22));
|
||||
|
|
Loading…
Reference in New Issue