Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs #166

Merged
merged 6 commits into from
Feb 27, 2020
Merged

Dialogs #166

merged 6 commits into from
Feb 27, 2020

Conversation

we7u
Copy link
Member

@we7u we7u commented Feb 25, 2020

This is the first run-through of adding Scrolledwindow to dialogs. This allows computers with small-resolution screens to still run/configure Xastir. There's more yet to do but this fixes up many of the dialogs (around 40 of them). I added code so the scrollbars are not visible when the dialog first comes up: You must shrink the dialog to make them appear. The only downside I've seen so far is that the scrollbars in Scrolledwindow sometimes steal from scrollbars already in a dialog. Map Chooser and Map Chooser->Properties are examples of that: I'll have to redesign those dialogs (later) to fix that, but they're still quite usable as-is.
I pushed my branch to the main Xastir repo by mistake so I think the easiest cleanup is to merge these changes with master rather than deleting this branch. I'll continue the rest of the work on the we7u fork and do pull requests later from there. I'm not going to merge this one myself: I want you guys to take a look at it and ok it.
These changes are working on issue #138

This is the first step in making the dialogs resizable in a
meaningful manner. This change allows them to resize but now we need
to make sure there are scrollbars and a widget manager in each dialog
so they can resize and still be useful.
Xastir doesn't play well on low-resolution screens. This change will
allow users to shrink many dialogs, gaining scrollbars so the dialogs
can still be manipulated on smaller screens.
Capitalization was wrong compared to other nearby labels.
Comment data field was overwriting widgets to the right. It is now
set to be smaller for display but the underlying data field can still
hold the max value it could before.
Copy link
Contributor

@godfreja godfreja left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, but I am not that up on the X11 side of things. I had a few minor comments / questions.

@@ -5071,8 +5078,22 @@ void Change_tactical(Widget UNUSED(w), XtPointer UNUSED(clientData), XtPointer U
XtManageChild(my_form);
XtManageChild(pane);

// Resize dialog to exactly fit form w/o scrollbars
Copy link
Contributor

Choose a reason for hiding this comment

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

Ignorant question - Do we need / should there be a check to limit the size to the lesser of form size or screen size?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about either doing that or having a "max gui size" variable in Xastir for this. Will consider adding that after I get all the dialogs to have scrollbars.

src/draw_symbols.c Outdated Show resolved Hide resolved
src/maps.c Outdated Show resolved Hide resolved
Copy link
Member

@tvrusso tvrusso left a comment

Choose a reason for hiding this comment

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

Please undo changes made to MAGICK ifdefs in maps.c.

Will review again after that's done.

@tvrusso tvrusso linked an issue Feb 26, 2020 that may be closed by this pull request
I got out of sync somewhere with the master branch and committed
some unintended changes. This should fix that problem.
@we7u
Copy link
Member Author

we7u commented Feb 26, 2020

Looks like main.c is missing the MAGICK stuff at lines 93, 29830, 30156. Also at main.c:6345 and 9048 there's DBFAWK stuff that has changed.

@tvrusso
Copy link
Member

tvrusso commented Feb 26, 2020

Ugh. Yes, it looks very much like some other commits got undone by your changes, perhaps because were not up-to-date in the branch that you were working on? The DBFAWK changes that got undone here are part of the commits for #155.

Because my branch was messed up compared to master and would have removed
multiple commits already done if it were merged as it was. While I was at
it I got rid of some commented-out code, removed the fix_dialog_vsize()
function, and fixed another few spelling errors.
@we7u
Copy link
Member Author

we7u commented Feb 26, 2020

The latest commit should bring everything up-to-date with master plus get rid of commented-out code near where I was working in each dialog. Ready for checking again for a possible merge.

@tvrusso
Copy link
Member

tvrusso commented Feb 27, 2020

This looks a lot better, I have not spotted changes that look like they undo other work on master. I would rather not just merge it based on my once-over eyeballing of the code --- I would actually like to test it out on a small screen and see how things have changed for the better. I will not have time to do that until at least Saturday.

I do have a 7" screen and a spare Raspberry Pi on which i've previously built Xastir --- building this branch will not be a huge deal. Can you tell me which dialogs I should check out for usability? I would rather not have to pick through the code to figure out which ones have changed.

@tvrusso tvrusso self-requested a review February 27, 2020 00:07
@we7u
Copy link
Member Author

we7u commented Feb 27, 2020

Some of the large ones would be Station Config and Station Defaults. Probably look at Map Chooser and Map Chooser -> Properties as well. Most dialogs you can get to from the menus have been tweaked, minus File->Open Log, which I haven't touched yet. Even the stuff on the right-click mouse menu has been tweaked. You can test it on any size monitor: Just shrink the dialog and see what happens.

Copy link
Member

@tvrusso tvrusso left a comment

Choose a reason for hiding this comment

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

I have reviewed the changes here and now see no instances of regressions due to the way the code was handled. I have also built the code and tested some of the new capability, and see that when a dialog is scaled to smaller than its contents it automatically gets scroll bars.

What I have not done is to test this out on a small screen to see if the dialogs are automatically sized appropriately for the screen, which seems a necessary feature --- if the dialog pops up too big for the screen, can one get to its corners to resize it? Should one have to?

This may be related to Jason's comment, which you answered already.
I'm OK with merging this. I would prefer that the commits here be squashed rather than preserved, because that will end up hiding the "undo other commits/redo them" aspect of this branch, which is a little ugly.

@we7u
Copy link
Member Author

we7u commented Feb 27, 2020

A little ugly... You're telling me! hi hi
The auto-resizing for small screens that Jason thought up is where I want to go, but it's not in there yet. I also have more dialogs yet to go, although I've probably done 2/3 of them in these commits. I'll figure out how to squash the commits together before I'm done here. I plan to get rid of my main-repo checkouts on multiple machines so I don't repeat the accidental push-to-the-wrong-repo thing anytime soon. I'll do it from my personal fork instead which is much cleaner.

@tvrusso
Copy link
Member

tvrusso commented Feb 27, 2020 via email

@tvrusso tvrusso merged commit b4c555f into master Feb 27, 2020
@tvrusso tvrusso deleted the dialogs branch February 27, 2020 22:19
we7u added a commit to we7u/Xastir that referenced this pull request Feb 28, 2020
* Comment out all calls to fix_dialog_size()

This is the first step in making the dialogs resizable in a
meaningful manner. This change allows them to resize but now we need
to make sure there are scrollbars and a widget manager in each dialog
so they can resize and still be useful.

* Add scrollbars to many dialogs

Xastir doesn't play well on low-resolution screens. This change will
allow users to shrink many dialogs, gaining scrollbars so the dialogs
can still be manipulated on smaller screens.

* Correct capitalization on label

Capitalization was wrong compared to other nearby labels.

* Correct length of Comment field for Object dialogs

Comment data field was overwriting widgets to the right. It is now
set to be smaller for display but the underlying data field can still
hold the max value it could before.

* Fix MAGICK ifdef's I messed up in the last 4 commits

I got out of sync somewhere with the master branch and committed
some unintended changes. This should fix that problem.

* Apply changes already in master plus a few more

Because my branch was messed up compared to master and would have removed
multiple commits already done if it were merged as it was. While I was at
it I got rid of some commented-out code, removed the fix_dialog_vsize()
function, and fixed another few spelling errors.
Sign up for free to 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.

Rework GUI dialogs: Add manager, and scrollbars when necessary
3 participants