[haiku-commits] Change in haiku[master]: ShowImage: fix scrollbar size

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 28 Feb 2021 10:25:41 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3755 ;)


Change subject: ShowImage: fix scrollbar size
......................................................................

ShowImage: fix scrollbar size
---
M src/apps/showimage/ShowImageWindow.cpp
1 file changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/55/3755/1

diff --git a/src/apps/showimage/ShowImageWindow.cpp 
b/src/apps/showimage/ShowImageWindow.cpp
index 8def063..8ca0a6b 100644
--- a/src/apps/showimage/ShowImageWindow.cpp
+++ b/src/apps/showimage/ShowImageWindow.cpp
@@ -171,7 +171,7 @@

        // Create the tool bar
        BRect viewFrame = contentView->Bounds();
-       viewFrame.right -= B_V_SCROLL_BAR_WIDTH;
+       viewFrame.right -= B_V_SCROLL_BAR_WIDTH * be_plain_font->Size() / 12.f;
        fToolBar = new BToolBar(viewFrame);

        // Add the tool icons.
@@ -222,7 +222,7 @@
        fToolBarVisible = fShowToolBar;

        viewFrame.bottom = contentView->Bounds().bottom;
-       viewFrame.bottom -= B_H_SCROLL_BAR_HEIGHT;
+       viewFrame.bottom -= B_H_SCROLL_BAR_HEIGHT * be_plain_font->Size() / 
12.f;

        // create the image view
        fImageView = new ShowImageView(viewFrame, "image_view", B_FOLLOW_ALL,
@@ -494,9 +494,9 @@

        // TODO: use View::GetPreferredSize() instead?
        BRect r(bitmap->Bounds());
-       float width = r.Width() + B_V_SCROLL_BAR_WIDTH;
+       float width = r.Width() + B_V_SCROLL_BAR_WIDTH * be_plain_font->Size() 
/ 12.f;
        float height = r.Height() + 1 + fBar->Frame().Height()
-               + B_H_SCROLL_BAR_HEIGHT;
+               + B_H_SCROLL_BAR_HEIGHT * be_plain_font->Size() / 12.f;

        BRect frame = screen.Frame();
        const float windowBorder = 5;
@@ -1299,8 +1299,8 @@
                fWindowFrame = Frame();
                frame = screen.Frame();
                frame.top -= fBar->Bounds().Height() + 1;
-               frame.right += B_V_SCROLL_BAR_WIDTH;
-               frame.bottom += B_H_SCROLL_BAR_HEIGHT;
+               frame.right += B_H_SCROLL_BAR_HEIGHT * be_plain_font->Size() / 
12.f;
+               frame.bottom += B_H_SCROLL_BAR_HEIGHT * be_plain_font->Size() / 
12.f;

                SetFlags(Flags() | B_NOT_RESIZABLE | B_NOT_MOVABLE);


--
To view, visit https://review.haiku-os.org/c/haiku/+/3755
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I5c50bd9a842ce79d78b6e9c2227dc37e3c52c6e6
Gerrit-Change-Number: 3755
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: ShowImage: fix scrollbar size - Gerrit