mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
Save built-in browser size
This commit is contained in:
parent
e99b54e525
commit
99e5516ee2
@ -21,10 +21,13 @@
|
|||||||
#include <wx/mimetype.h>
|
#include <wx/mimetype.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/uri.h>
|
#include <wx/uri.h>
|
||||||
|
#include <wx/settings.h>
|
||||||
|
#include <wx/log.h>
|
||||||
|
|
||||||
#include "LinkingHtmlWindow.h"
|
#include "LinkingHtmlWindow.h"
|
||||||
#include "../HelpText.h"
|
#include "../HelpText.h"
|
||||||
#include "../FileNames.h"
|
#include "../FileNames.h"
|
||||||
|
#include "../Prefs.h"
|
||||||
#include "ErrorDialog.h"
|
#include "ErrorDialog.h"
|
||||||
#include "HelpSystem.h"
|
#include "HelpSystem.h"
|
||||||
|
|
||||||
@ -39,7 +42,20 @@ END_EVENT_TABLE()
|
|||||||
BrowserDialog::BrowserDialog(wxWindow *pParent, const wxString &title)
|
BrowserDialog::BrowserDialog(wxWindow *pParent, const wxString &title)
|
||||||
: wxDialogWrapper{ pParent, ID, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER /*| wxMAXIMIZE_BOX */ }
|
: wxDialogWrapper{ pParent, ID, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER /*| wxMAXIMIZE_BOX */ }
|
||||||
{
|
{
|
||||||
|
int width, height;
|
||||||
|
const int minWidth = 400;
|
||||||
|
const int minHeight = 250;
|
||||||
|
|
||||||
|
gPrefs->Read(wxT("/GUI/BrowserWidth"), &width, minWidth);
|
||||||
|
gPrefs->Read(wxT("/GUI/BrowserHeight"), &height, minHeight);
|
||||||
|
|
||||||
|
if (width < minWidth || width > wxSystemSettings::GetMetric(wxSYS_SCREEN_X))
|
||||||
|
width = minWidth;
|
||||||
|
if (height < minHeight || height > wxSystemSettings::GetMetric(wxSYS_SCREEN_Y))
|
||||||
|
height = minHeight;
|
||||||
|
|
||||||
|
SetMinSize(wxSize(minWidth, minHeight));
|
||||||
|
SetSize(wxDefaultPosition.x, wxDefaultPosition.y, width, height, wxSIZE_AUTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserDialog::OnForward(wxCommandEvent & WXUNUSED(event))
|
void BrowserDialog::OnForward(wxCommandEvent & WXUNUSED(event))
|
||||||
@ -63,6 +79,10 @@ void BrowserDialog::OnClose(wxCommandEvent & WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
auto parent = GetParent();
|
auto parent = GetParent();
|
||||||
|
|
||||||
|
gPrefs->Write(wxT("/GUI/BrowserWidth"), GetSize().GetX());
|
||||||
|
gPrefs->Write(wxT("/GUI/BrowserHeight"), GetSize().GetY());
|
||||||
|
gPrefs->Flush();
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
auto grandparent = GetParent()->GetParent();
|
auto grandparent = GetParent()->GetParent();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user