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

Align right bottom #520

Merged
merged 4 commits into from
Oct 31, 2023
Merged

Align right bottom #520

merged 4 commits into from
Oct 31, 2023

Conversation

Rdornier
Copy link
Contributor

@Rdornier Rdornier commented Oct 3, 2023

Add a button to align images to the right and to the bottom
Fix #483 issue

@will-moore
Copy link
Member

This works OK if all the panels are the same width or height, but if they aren't then it should probably still align the right or bottom edges. So you need to combine x and width to find the right edge for each, and the max right-edge. Then subtract the width of each panel from that value when setting the x. And same logic for bottom alignment.

@Rdornier
Copy link
Contributor Author

Rdornier commented Oct 6, 2023

Arf... I was doing my tests on multiple copies of the same image and did see that.
Thansk for reporting this bug !

@will-moore
Copy link
Member

This is working well now.

There's a minor issue with the extra space being taken up on the tool bar: The extra buttons are contributing to an existing bug where the toolbar is spreading into space used by the figure title, which is an issue if you have a longer title or narrow browser page:

Screenshot 2023-10-09 at 18 16 29

The previous issue of a gap to the right of the toolbar can be fixed by moving it to the right.
Then we still need to reduce the space used by the title.
With these changes...

diff --git a/omero_figure/static/figure/css/figure.css b/omero_figure/static/figure/css/figure.css
index 332b657..f5b049c 100644
--- a/omero_figure/static/figure/css/figure.css
+++ b/omero_figure/static/figure/css/figure.css
@@ -123,7 +123,7 @@
         line-height: 20px;
         padding: 12px;
         position: absolute;
-        right: 450px;
+        right: 520px;
         text-align: center;
         height: 100%;
     }
@@ -705,6 +705,10 @@
     .navbar>div.container {
         max-width: 100%;
     }
+    #alignment-toolbars {
+        padding-right: 0;
+        margin-right: -15px;
+    }
     /** Add my class to boost size of font icons **/
     .icon-buttons {
         margin-right: 20px;

Looks a bit better:

Screenshot 2023-10-09 at 18 29 21

@Rdornier
Copy link
Contributor Author

It can indeed be annoying; thank you for your meticulous tests !

@jburel jburel merged commit 178d0e6 into ome:master Oct 31, 2023
1 check passed
@will-moore will-moore added this to the 6.1.0 milestone Nov 2, 2023
@Rdornier Rdornier deleted the align-right-bottom branch June 13, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align panels by right or bottom edges
3 participants