viewertexteditor: shifted code to class [skip ci]
Minor code organization
This commit is contained in:
@@ -344,8 +344,6 @@ void ViewerDisplayWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
text_edit->setGeometry(transformed_geom.toRect());
|
||||
|
||||
ViewerTextEditorToolBar *toolbar = new ViewerTextEditorToolBar(this);
|
||||
toolbar->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
|
||||
toolbar->resize(toolbar->sizeHint());
|
||||
|
||||
QPoint pos = mapToGlobal(QPoint(transformed_geom.x(), transformed_geom.y() - toolbar->height()));
|
||||
for (QScreen *screen : qApp->screens()) {
|
||||
|
||||
@@ -321,7 +321,7 @@ void ViewerTextEditor::DocumentChanged()
|
||||
}
|
||||
|
||||
ViewerTextEditorToolBar::ViewerTextEditorToolBar(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
QWidget(parent, Qt::Tool | Qt::FramelessWindowHint),
|
||||
painted_(false)
|
||||
{
|
||||
QVBoxLayout *outer_layout = new QVBoxLayout(this);
|
||||
@@ -449,6 +449,8 @@ ViewerTextEditorToolBar::ViewerTextEditorToolBar(QWidget *parent) :
|
||||
advanced_layout->addStretch();
|
||||
|
||||
setAutoFillBackground(true);
|
||||
|
||||
resize(sizeHint());
|
||||
}
|
||||
|
||||
void ViewerTextEditorToolBar::SetAlignment(Qt::Alignment a)
|
||||
|
||||
Reference in New Issue
Block a user