Skip to content

MapEditorController: Refactor map notes window - #2272

Merged
dg0yt merged 9 commits into
OpenOrienteering:masterfrom
dl3sdo:increase-map-notes
Dec 1, 2024
Merged

MapEditorController: Refactor map notes window#2272
dg0yt merged 9 commits into
OpenOrienteering:masterfrom
dl3sdo:increase-map-notes

Conversation

@dl3sdo

Copy link
Copy Markdown
Member

The map notes dialog was quite small and did not automatically adjust itself to the size of the map notes upon creation. This commit defines a minimum and maximum window size and adjusts the size wthin these limits according to the size of the map notes.

Closes#2119

@dl3sdo

dl3sdo commented Aug 5, 2024

Copy link
Copy Markdown
MemberAuthor

Minimum size (appearance after opening dialog):
EmtpyNotes

Maximum size (appearance after opening dialog):
FullNotes

@dl3sdo
dl3sdoforce-pushed the increase-map-notes branch from f7467aa to dbc49f4CompareAugust 5, 2024 20:03
@lpechacek
lpechacek self-requested a review August 6, 2024 06:22
@dg0yt

Copy link
Copy Markdown
Member

IMO this dialog shouldn't be maintainted of the map_editor.cpp monster.

@dl3sdo

Copy link
Copy Markdown
MemberAuthor

I agree, and I will move it to a separate file.

@dl3sdo
dl3sdo marked this pull request as draft November 25, 2024 07:46
@dl3sdodl3sdo changed the title MapEditorController: Increase size of map notes windowMapEditorController: Refactor map notes windowNov 25, 2024
The map notes dialog was quite small and did not automatically
adjust itself to the size of the map notes upon creation.
This commit defines a minimum and maximum window size and adjusts the
size wthin these limits according to the size of the map notes.
The map notes dialog had a non-standard button layout (with the
Cancel button on the left side and the OK button on the right side).
In addition both buttons were non-standard buttons (the OK button
contained a green right arrow as icon).
Change the map notes dialog layout to use standard buttons as for all
other dialogs in Mapper.

@dg0ytdg0yt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to guard against map == nullptr?

Comment threadsrc/gui/map/map_notes.cpp Outdated
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
, map { map }
{
setWindowTitle(QCoreApplication::translate("OpenOrienteering::MapNotes", "Map notes"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either

Suggested change
setWindowTitle(QCoreApplication::translate("OpenOrienteering::MapNotes", "Map notes"));
setWindowTitle(QCoreApplication::translate("OpenOrienteering::MapEditorController", "Map notes"));

or

Suggested change
setWindowTitle(QCoreApplication::translate("OpenOrienteering::MapNotes", "Map notes"));
setWindowTitle(tr("Map notes"));

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choosing setWindowTitle(tr("Map notes"));

@dl3sdodl3sdoNov 26, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to guard against map == nullptr?

I think that it's not possible to select this menu item without having a valid map. At least scaleMapClicked() does not check it neither and RotateMapDialog even does dereference the pointer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay... You are the key user for crashing other people's software.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy check OTOH.

Comment threadsrc/gui/map/map_notes.cpp Outdated
Comment on lines +62 to +63
width = qMax(300, qMin(width, bounding_rect.width() + 60));
height = qMax(200, qMin(height, bounding_rect.height() + 80));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
width = qMax(300, qMin(width, bounding_rect.width() + 60));
height = qMax(200, qMin(height, bounding_rect.height() + 80));
width = qBound(300, width, bounding_rect.width() + 60);
height = qBound(200, height, bounding_rect.height() + 80);

@PappyEric

PappyEric commented Nov 26, 2024 via email

Copy link
Copy Markdown

@dg0yt

Copy link
Copy Markdown
Member

Take a technical degree to install???

Be careful. Humans on both sides.

@PappyEric

PappyEric commented Nov 26, 2024 via email

Copy link
Copy Markdown

@PappyEric

PappyEric commented Nov 26, 2024 via email

Copy link
Copy Markdown

@dg0yt

Copy link
Copy Markdown
Member

Let me reiterate, I've tried to install the GIT version of Openorienteering so I could maybe add some input. Tried, and tried again.

Let me reiterate:
If you want to ask for help with building from source, open an issue or discussion.
If you want to not slow down things, kindly avoid rants on unrelated issues and PRs.

@PappyEric

PappyEric commented Nov 26, 2024 via email

Copy link
Copy Markdown

@dg0yt

Copy link
Copy Markdown
Member

@PappyEric Sorry, I have to put you on my block list. Toxic discussion are not beneficial.

@lpechacek

Copy link
Copy Markdown
Member

@PappyEric No matter how much I understand your position and why you are discussing your issue right here, please mind that discussion is off-topic in the context of this code pull request. The Discussions place might be a better home for conversations about the project leadership, perhaps with a more articulated set of reproaches and honors towards the OO developers team. Thanks!

@PappyEric

Copy link
Copy Markdown

@PappyEric No matter how much I understand your position and why you are discussing your issue right here, please mind that discussion is off-topic in the context of this code pull request. The Discussions place might be a better home for conversations about the project leadership, perhaps with a more articulated set of reproaches and honors towards the OO developers team. Thanks!

Sorry

@dl3sdo
dl3sdo marked this pull request as ready for review November 26, 2024 10:43
@dl3sdo

Copy link
Copy Markdown
MemberAuthor

Shall I keep three commits (I would split the 4th one and squash appropriately) or shall I squash and update the commit message?

@dg0yt

Copy link
Copy Markdown
Member

I would squash the PR with the merge. Unless you want control over the commit message 😄

@dg0yt

Copy link
Copy Markdown
Member

FTR I want to limit width because long lines are hard to read.
screenshot

@dg0yt

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@dg0yt

Copy link
Copy Markdown
Member

I should really fix the flaky hdiutil job at its root 😠

@dg0yt
dg0yt merged commit 39ca931 into OpenOrienteering:masterDec 1, 2024
lpechacek pushed a commit to lpechacek/mapper that referenced this pull request Oct 15, 2025
Moved out of MapEditorController.
Improved window size calculation using available space
while maintaining a readable max width.
Use standard buttons and layout for map notes dialog.
Co-authored-by: Kai Pastor <dg0yt@darc.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: increase size of 'Map notes' window

4 participants

@dl3sdo@dg0yt@PappyEric@lpechacek