Ticket #7467: 0001-Added-resize-to-fit-shortcuts.-Partially-fixes-7467.patch

File 0001-Added-resize-to-fit-shortcuts.-Partially-fixes-7467.patch, 4.0 KB (added by diver, 8 years ago)

Add resize to fit shortcut to Open with and file panel windows

  • src/kits/tracker/ContainerWindow.cpp

    From 9eeef4fbbb78f4930ee7c12dcb5aea53b4ed5207 Mon Sep 17 00:00:00 2001
    From: Reznikov Sergei <diver@gelios.net>
    Date: Mon, 21 May 2012 17:10:47 +0400
    Subject: [PATCH] Added resize to fit shortcuts. Partially fixes #7467.
    
    * Adjusted initial tracker windows width to fit modified column.
    * Resolved a TODO: Added get info shortcut to Open with window.
    
     Author:    Sergei Reznikov <diver@gelios.net>
    ---
     src/kits/tracker/ContainerWindow.cpp     |    2 +-
     src/kits/tracker/FilePanelPriv.cpp       |    7 ++++++-
     src/kits/tracker/OpenWithWindow.cpp      |    9 +++++++--
     src/kits/tracker/TrackerInitialState.cpp |    2 +-
     4 files changed, 15 insertions(+), 5 deletions(-)
    
    diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
    index be5af6b..bcbb092 100644
    a b const int32 kContainerWindowHeightLimit = 85;  
    141141
    142142const int32 kWindowStaggerBy = 17;
    143143
    144 BRect BContainerWindow::sNewWindRect(85, 50, 415, 280);
     144BRect BContainerWindow::sNewWindRect(85, 50, 548, 280);
    145145
    146146
    147147namespace BPrivate {
  • src/kits/tracker/FilePanelPriv.cpp

    diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp
    index f42b55b..a4a9b41 100644
    a b TFilePanel::TFilePanel(file_panel_mode mode, BMessenger *target,  
    159159
    160160    fIsSavePanel = (mode == B_SAVE_PANEL);
    161161
    162     BRect windRect(85, 50, 510, 296);
     162    BRect windRect(85, 50, 568, 296);
    163163    MoveTo(windRect.LeftTop());
    164164    ResizeTo(windRect.Width(), windRect.Height());
    165165
    TFilePanel::Init(const BMessage *)  
    739739    AddShortcut('A', B_COMMAND_KEY | B_SHIFT_KEY, new BMessage(kShowSelectionWindow));
    740740    AddShortcut('A', B_COMMAND_KEY, new BMessage(B_SELECT_ALL), PoseView());
    741741    AddShortcut('S', B_COMMAND_KEY, new BMessage(kInvertSelection), PoseView());
     742    AddShortcut('Y', B_COMMAND_KEY, new BMessage(kResizeToFit), PoseView());
    742743    AddShortcut(B_DOWN_ARROW, B_COMMAND_KEY, new BMessage(kOpenDir));
    743744    AddShortcut(B_DOWN_ARROW, B_COMMAND_KEY | B_OPTION_KEY, new BMessage(kOpenDir));
    744745    AddShortcut(B_UP_ARROW, B_COMMAND_KEY, new BMessage(kOpenParentDir));
    TFilePanel::MessageReceived(BMessage *message)  
    11821183            PostMessage(B_QUIT_REQUESTED);
    11831184            break;
    11841185
     1186        case kResizeToFit:
     1187            ResizeToFit();
     1188            break;
     1189
    11851190        case kOpenDir:
    11861191            OpenDirectory();
    11871192            break;
  • src/kits/tracker/OpenWithWindow.cpp

    diff --git a/src/kits/tracker/OpenWithWindow.cpp b/src/kits/tracker/OpenWithWindow.cpp
    index cfefdc9..464a1ee 100644
    a b OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,  
    8484{
    8585    AutoLock<BWindow> lock(this);
    8686
    87     BRect windowRect(85, 50, 510, 296);
     87    BRect windowRect(85, 50, 718, 296);
    8888    MoveTo(windowRect.LeftTop());
    8989    ResizeTo(windowRect.Width(), windowRect.Height());
    9090
    OpenWithContainerWindow::MessageReceived(BMessage *message)  
    328328
    329329        case B_OBSERVER_NOTICE_CHANGE:
    330330            return;
     331
     332        case kResizeToFit:
     333            ResizeToFit();
     334            break;
    331335    }
    332336    _inherited::MessageReceived(message);
    333337}
    OpenWithContainerWindow::ShowContextMenu(BPoint, const entry_ref *, BView *)  
    368372void
    369373OpenWithContainerWindow::AddShortcuts()
    370374{
    371     // add get info here
     375    AddShortcut('I', B_COMMAND_KEY, new BMessage(kGetInfo), PoseView());
     376    AddShortcut('Y', B_COMMAND_KEY, new BMessage(kResizeToFit), PoseView());
    372377}
    373378
    374379
  • src/kits/tracker/TrackerInitialState.cpp

    diff --git a/src/kits/tracker/TrackerInitialState.cpp b/src/kits/tracker/TrackerInitialState.cpp
    index ca1dc12..9229de3 100644
    a b const char *kPeopleSignature = "application/x-vnd.Be-PEPL";  
    9696// file system endianness swapping, etc., the correct endianness for the
    9797// correct machine has to be used here
    9898
    99 const BRect kDefaultFrame(40, 40, 500, 350);
     99const BRect kDefaultFrame(40, 40, 695, 350);
    100100const int32 kDefaultQueryTemplateCount = 3;
    101101
    102102const AttributeTemplate kDefaultQueryTemplate[] =