diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index c07bb7bc..1ca0f6e0 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -467,7 +467,7 @@ - + 0 @@ -488,132 +488,159 @@ - 4 + 3 - 4 + 3 - 4 + 3 - 4 + 3 - 4 + 3 - - - true + + + QFrame::NoFrame - - <html><head/><body><p>Pencil</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html> - - - Paint - - - - :/icons/pencil.ico:/icons/pencil.ico - - - true - - - true - - - false - - - - - - - true - - - <html><head/><body><p>Pointer</p><p>Does nothing</p></body></html> - - - Select - - - - :/icons/cursor.ico:/icons/cursor.ico - - - true - - - - - - - <html><head/><body><p>Bucket Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html> - - - Fill - - - - :/icons/fill_color.ico:/icons/fill_color.ico - - - true - - - - - - - <html><head/><body><p>Eyedropper</p><p><span style=" font-weight:600;">Click</span> to select a metatile or collision attribute.</p></body></html> - - - Dropper - - - - :/icons/pipette.ico:/icons/pipette.ico - - - true - - - - - - - <html><head/><body><p>Move</p><p>Click to drag map around.</p></body></html> - - - ... - - - - :/icons/move.ico:/icons/move.ico - - - true - - - - - - - <html><head/><body><p>Map Shift</p><p><span style=" font-weight:600;">Click and drag</span> on the map to shift the positions of all metatiles (Map tab) or events (Events tab) at once. This is useful after resizing a map.</p></body></html> - - - Shift - - - - :/icons/shift.ico:/icons/shift.ico - - - true + + QFrame::Raised + + + 3 + + + 0 + + + 0 + + + 9 + + + 0 + + + + + true + + + <html><head/><body><p>Pencil</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html> + + + Paint + + + + :/icons/pencil.ico:/icons/pencil.ico + + + true + + + true + + + false + + + + + + + true + + + <html><head/><body><p>Pointer</p><p>Does nothing</p></body></html> + + + Select + + + + :/icons/cursor.ico:/icons/cursor.ico + + + true + + + + + + + <html><head/><body><p>Bucket Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html> + + + Fill + + + + :/icons/fill_color.ico:/icons/fill_color.ico + + + true + + + + + + + <html><head/><body><p>Eyedropper</p><p><span style=" font-weight:600;">Click</span> to select a metatile or collision attribute.</p></body></html> + + + Dropper + + + + :/icons/pipette.ico:/icons/pipette.ico + + + true + + + + + + + <html><head/><body><p>Move</p><p>Click to drag map around.</p></body></html> + + + ... + + + + :/icons/move.ico:/icons/move.ico + + + true + + + + + + + <html><head/><body><p>Map Shift</p><p><span style=" font-weight:600;">Click and drag</span> on the map to shift the positions of all metatiles (Map tab) or events (Events tab) at once. This is useful after resizing a map.</p></body></html> + + + Shift + + + + :/icons/shift.ico:/icons/shift.ico + + + true + + + + @@ -621,9 +648,6 @@ <html><head/><body><p>Smart-path mode allows easier drawing of paths. If a 3x3 metatile block is selcted in the right panel, then smart path mode will automatically form a pathway using those selected blocks.</p><p>When smart-path mode is <span style=" font-weight:600;">not</span> enabled, clicking and dragging a selection will tile it in a grid.</p><p>Hold down the <span style=" font-weight:600;">shift</span> key while editing to quickly enable smart-path mode.</p></body></html> - - margin-left: 10px - Smart Paths diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e2ae8bdb..7c4436bf 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -13,6 +13,7 @@ #include "adjustingstackedwidget.h" #include "draggablepixmapitem.h" #include "editcommands.h" +#include "flowlayout.h" #include #include @@ -135,6 +136,19 @@ void MainWindow::initCustomUI() { connect(labelCombo, QOverload::of(&QComboBox::currentIndexChanged), [=](int index){ stack->setCurrentIndex(index); }); + + // Convert the layout of the map tools' frame into an adjustable FlowLayout + FlowLayout *flowLayout = new FlowLayout; + flowLayout->setContentsMargins(ui->frame_mapTools->layout()->contentsMargins()); + flowLayout->setSpacing(ui->frame_mapTools->layout()->spacing()); + for (auto *child : ui->frame_mapTools->findChildren(QString(), Qt::FindDirectChildrenOnly)) { + flowLayout->addWidget(child); + child->setFixedHeight( + ui->frame_mapTools->height() - flowLayout->contentsMargins().top() - flowLayout->contentsMargins().bottom() + ); + } + delete ui->frame_mapTools->layout(); + ui->frame_mapTools->setLayout(flowLayout); } void MainWindow::initExtraSignals() {