Commit 92a9e12b authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

update geometry in parent, no need to do everywhere


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent 65dd1a4b
......@@ -178,14 +178,9 @@ GotoSymbolHUDDialog::GotoSymbolHUDDialog(KTextEditor::MainWindow *mainWindow, QS
, mainWindow(mainWindow)
, server(std::move(server))
{
auto pal = m_treeView.palette();
auto e = KTextEditor::Editor::instance();
auto bg = QColor::fromRgba(e->theme().editorColor(KSyntaxHighlighting::Theme::BackgroundColor));
pal.setColor(QPalette::Base, bg);
m_treeView.setPalette(pal);
setPaletteToEditorColors();
m_treeView.setModel(model);
auto delegate = new GotoSymbolHUDStyleDelegate(this);
delegate->setColors();
delegate->setFont(getViewFont(mainWindow));
......@@ -194,6 +189,17 @@ GotoSymbolHUDDialog::GotoSymbolHUDDialog(KTextEditor::MainWindow *mainWindow, QS
connect(&m_lineEdit, &QLineEdit::textChanged, this, &GotoSymbolHUDDialog::slotTextChanged);
}
void GotoSymbolHUDDialog::setPaletteToEditorColors()
{
auto pal = m_treeView.palette();
auto e = KTextEditor::Editor::instance();
auto bg = QColor::fromRgba(e->theme().editorColor(KSyntaxHighlighting::Theme::BackgroundColor));
auto fg = QColor::fromRgba(e->theme().textColor(KSyntaxHighlighting::Theme::Normal));
pal.setColor(QPalette::Base, bg);
pal.setColor(QPalette::Text, fg);
m_treeView.setPalette(pal);
}
void GotoSymbolHUDDialog::slotReturnPressed()
{
auto symbol = m_treeView.currentIndex().data(SymbolInfoRole).value<GotoSymbolItem>();
......@@ -210,8 +216,6 @@ void GotoSymbolHUDDialog::slotReturnPressed()
void GotoSymbolHUDDialog::openDialog()
{
updateViewGeometry();
setFocus();
exec();
}
......
......@@ -31,6 +31,7 @@ protected Q_SLOTS:
private:
void slotTextChanged(const QString &text);
QIcon iconForSymbolKind(LSPSymbolKind kind) const;
void setPaletteToEditorColors();
QStandardItemModel *model = nullptr;
KTextEditor::MainWindow *mainWindow;
......
......@@ -178,8 +178,6 @@ void BranchesDialog::openDialog(GitUtils::RefType r)
m_model->refresh(branches);
reselectFirst();
updateViewGeometry();
setFocus();
exec();
}
......
......@@ -20,9 +20,6 @@ void PushPullDialog::openDialog(PushPullDialog::Mode m)
} else if (m == Pull) {
m_lineEdit.setText(buildPullString());
}
updateViewGeometry();
setFocus();
exec();
}
......@@ -102,6 +99,5 @@ void PushPullDialog::slotReturnPressed()
}
}
clearLineEdit();
hide();
}
......@@ -184,8 +184,6 @@ void StashDialog::openDialog(StashMode m)
// trigger reselect first
m_lineEdit.textChanged(QString());
updateViewGeometry();
setFocus();
exec();
}
......@@ -217,7 +215,6 @@ void StashDialog::slotReturnPressed()
break;
}
clearLineEdit();
hide();
}
......
......@@ -47,6 +47,9 @@ QuickDialog::QuickDialog(QWidget *parent, QWidget *mainWindow)
m_treeView.setRootIsDecorated(false);
m_treeView.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_treeView.setSelectionMode(QTreeView::SingleSelection);
updateViewGeometry();
setFocus();
}
bool QuickDialog::eventFilter(QObject *obj, QEvent *event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment