Skip to content

Commit

Permalink
Show size grip in ascent and trip dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Vetter committed Mar 5, 2024
1 parent 27e538f commit 437fe55
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/dialogs/ascent_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ using std::unique_ptr, std::make_unique;
* @param init The ascent data to initialize the dialog with and store as initial data. AscentDialog takes ownership of this pointer.
*/
AscentDialog::AscentDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle, unique_ptr<const Ascent> init) :
ItemDialog(parent, mainWindow, db, purpose, windowTitle),
ItemDialog(parent, mainWindow, db, purpose, windowTitle, true),
init(std::move(init)),
selectableRegionIDs(QList<ValidItemID>()),
selectablePeakIDs(QList<ValidItemID>()),
Expand Down
17 changes: 10 additions & 7 deletions src/dialogs/item_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
/**
* Creates a new base item dialog.
*
* @param parent The parent window.
* @param mainWindow The application's main window.
* @param db The project database.
* @param purpose The purpose of the dialog.
* @param windowTitle The title of the dialog window.
* @param parent The parent window.
* @param mainWindow The application's main window.
* @param db The project database.
* @param purpose The purpose of the dialog.
* @param windowTitle The title of the dialog window.
* @param enableSizeGrip Whether to enable the size grip in the bottom right corner of the dialog.
*/
ItemDialog::ItemDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle):
ItemDialog::ItemDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle, bool enableSizeGrip):
QDialog(&parent),
parent(parent),
mainWindow(mainWindow),
Expand All @@ -49,7 +50,9 @@ ItemDialog::ItemDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, D
multiEditCheckboxes(QMap<QCheckBox*, QPair<QSet<QWidget*>, QSet<const Column*>>>()),
tristateCheckboxes(QMap<QCheckBox*, QSet<const Column*>>()),
savedWidgetEnabledStates(QMap<QCheckBox*, QMap<QWidget*, bool>>())
{}
{
setSizeGripEnabled(enableSizeGrip);
}



Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/item_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ItemDialog : public QDialog
QMap<QCheckBox*, QMap<QWidget*, bool>> savedWidgetEnabledStates;

protected:
ItemDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle);
ItemDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle, bool enableSizeGrip = false);

void setUIPointers(QPushButton* saveButton, const QMap<QCheckBox*, QPair<QSet<QWidget*>, QSet<const Column*>>>& multiEditCheckboxes, const QMap<QCheckBox*, QSet<const Column*>>& tristateCheckboxes = QMap<QCheckBox*, QSet<const Column*>>());
void changeUIForPurpose();
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/trip_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using std::unique_ptr, std::make_unique;
* @param init The trip data to initialize the dialog with and store as initial data. TripDialog takes ownership of this pointer.
*/
TripDialog::TripDialog(QWidget& parent, QMainWindow& mainWindow, Database& db, DialogPurpose purpose, const QString& windowTitle, unique_ptr<const Trip> init) :
ItemDialog(parent, mainWindow, db, purpose, windowTitle),
ItemDialog(parent, mainWindow, db, purpose, windowTitle, true),
init(std::move(init))
{
setupUi(this);
Expand Down

0 comments on commit 437fe55

Please sign in to comment.