Ticket #5588: SoundsZoom.diff

File SoundsZoom.diff, 1.3 KB (added by devine, 7 years ago)

This makes the Sounds zoom behave the same as Tracker's zoom.

  • src/preferences/sounds/HWindow.cpp

    diff --git a/src/preferences/sounds/HWindow.cpp b/src/preferences/sounds/HWindow.cpp
    index 8b0a92d..929cc4e 100644
    a b HWindow::HWindow(BRect rect, const char* name) 
    5252{
    5353    InitGUI();
    5454
     55    fAutoFrameSize = Frame();
     56
    5557    fFilePanel = new BFilePanel();
    5658    fFilePanel->SetTarget(this);
    5759
    HWindow::DispatchMessage(BMessage* message, BHandler* handler) 
    442444    BWindow::DispatchMessage(message, handler);
    443445}
    444446
     447void
     448HWindow::Zoom(BPoint origin, float width, float height)
     449{
     450    ResizeTo(fAutoFrameSize.Width(), fAutoFrameSize.Height());
     451}
    445452
    446453bool
    447454HWindow::QuitRequested()
  • src/preferences/sounds/HWindow.h

    diff --git a/src/preferences/sounds/HWindow.h b/src/preferences/sounds/HWindow.h
    index da27a99..737d174 100644
    a b public: 
    4040
    4141    virtual void                MessageReceived(BMessage* message);
    4242    virtual bool                QuitRequested();
     43    virtual void                Zoom(BPoint origin, float width, float height);
    4344    virtual void                DispatchMessage(BMessage* message,
    4445                                    BHandler* handler);
    4546            void                InitGUI();
    private: 
    5152            BFilePanel*         fFilePanel;
    5253            BFileGameSound*     fPlayer;
    5354            BRect               fFrame;
     55            BRect               fAutoFrameSize;
    5456};
    5557
    5658