From a9ab9d2c21ecd68f419ea16be2ca6bd708303e19 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Sat, 20 Jan 2007 03:18:10 +0000 Subject: [PATCH] Removed "Stippled Zooming" item and made dithering automatic in 8-bit screen mode "Keep Proportions" in resizing window became "Keep Original Proportions", which was suggested by korli and is the best suggestion IMO Bilinear scaling is on by default I like ShowImage's menus now. :^) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19877 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ResizerWindow.cpp | 4 ++-- src/apps/showimage/ShowImageView.cpp | 4 ++-- src/apps/showimage/ShowImageWindow.cpp | 6 +++++- src/apps/showimage/ShowImageWindow.h | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/apps/showimage/ResizerWindow.cpp b/src/apps/showimage/ResizerWindow.cpp index c62588e3bf..d4ed7e7077 100644 --- a/src/apps/showimage/ResizerWindow.cpp +++ b/src/apps/showimage/ResizerWindow.cpp @@ -43,7 +43,7 @@ static const char* kWidthLabel = "Width:"; static const char* kHeightLabel = "Height:"; -static const char* kKeepAspectRatioLabel = "Keep Proportions"; +static const char* kKeepAspectRatioLabel = "Keep Original Proportions"; static const char* kApplyLabel = "Apply"; static const float kLineDistance = 5; @@ -65,7 +65,7 @@ ResizerWindow::ResizerWindow(BMessenger target, int32 width, int32 height) const float column2 = max_c(widthLabelWidth, heightLabelWidth); const float textControlWidth = column2 + back_view->StringWidth("999999"); - const float keepAspectRatioLabelWidth = 15 + back_view->StringWidth(kKeepAspectRatioLabel); + const float keepAspectRatioLabelWidth = 20 + back_view->StringWidth(kKeepAspectRatioLabel); const float width2 = 2 * kHorizontalIndent + max_c(textControlWidth, keepAspectRatioLabelWidth); ResizeTo(width2+1, Bounds().Height()+1); diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 6f87ebc33a..84831d2411 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -181,7 +181,7 @@ ShowImageView::ShowImageView(BRect rect, const char *name, uint32 resizingMode, settings = my_app->Settings(); InitPatterns(); - fDither = false; + fDither = BScreen().ColorSpace() == B_CMAP8; fBitmap = NULL; fDisplayBitmap = NULL; fSelBitmap = NULL; @@ -197,7 +197,7 @@ ShowImageView::ShowImageView(BRect rect, const char *name, uint32 resizingMode, fShowCaption = false; fZoom = 1.0; fMovesImage = false; - fScaleBilinear = false; + fScaleBilinear = true; fScaler = NULL; #if DELAYED_SCALING fScalingCountDown = SCALING_DELAY_TIME; diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index ca22cf6618..d86bace683 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -246,7 +246,6 @@ ShowImageWindow::BuildViewMenu(BMenu *menu, bool popupMenu) menu->AddSeparatorItem(); AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, 0, 0, 'W', true); - AddItemMenu(menu, "Stippled Zooming", MSG_DITHER_IMAGE, 0, 0, 'W', true); menu->AddSeparatorItem(); @@ -1197,4 +1196,9 @@ ShowImageWindow::QuitRequested() } +void +ShowImageWindow::ScreenChanged(BRect frame, color_space mode) +{ + fImageView->SetDither(mode == B_CMAP8); +} diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h index 7700bef17f..0e0e8ad0fb 100644 --- a/src/apps/showimage/ShowImageWindow.h +++ b/src/apps/showimage/ShowImageWindow.h @@ -43,6 +43,7 @@ class ShowImageWindow : public BWindow { virtual void FrameResized(float width, float height); virtual void MessageReceived(BMessage *message); virtual bool QuitRequested(); + virtual void ScreenChanged(BRect frame, color_space mode); // virtual void Zoom(BPoint origin, float width, float height); status_t InitCheck();