Skip to content

Commit

Permalink
adjusted layout of side bar to center slider (flameshot-org#2093)
Browse files Browse the repository at this point in the history
  • Loading branch information
borgmanJeremy authored Nov 20, 2021
1 parent 12e295f commit 53cc11a
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/widgets/panel/sidepanelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,31 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
parent->installEventFilter(this);
}

QFormLayout* colorForm = new QFormLayout();
colorForm->setRowWrapPolicy(QFormLayout::WrapLongRows);
QGridLayout* colorLayout = new QGridLayout();

// Create Active Tool Size
QLabel* activeToolSizeText = new QLabel(tr("Active tool size: "));

m_toolSizeSlider = new QSlider(Qt::Horizontal);
m_toolSizeSlider->setRange(1, maxToolSize);
m_toolSizeSlider->setValue(m_toolSize);
m_toolSizeSlider->setMinimumWidth(minSliderWidth);

colorLayout->addWidget(activeToolSizeText, 0, 0);
colorLayout->addWidget(m_toolSizeSlider, 1, 0);

// Create Active Color
QHBoxLayout* colorHBox = new QHBoxLayout();
QLabel* colorText = new QLabel(tr("Active Color: "));

m_colorLabel = new QLabel();
m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
colorForm->addRow(tr("Active tool size:"), m_toolSizeSlider);
colorForm->addRow(tr("Active color:"), m_colorLabel);
m_layout->addLayout(colorForm);

colorHBox->addWidget(colorText);
colorHBox->addWidget(m_colorLabel);
colorLayout->addLayout(colorHBox, 2, 0);

m_layout->addLayout(colorLayout);

m_colorWheel = new color_widgets::ColorWheel(this);
m_colorWheel->setColor(m_color);
Expand Down

0 comments on commit 53cc11a

Please sign in to comment.