Skip to content
forked from BOINC/boinc

Commit

Permalink
[Manager] Convert ProcessorTab in Preferences dialog from wxPanel to …
Browse files Browse the repository at this point in the history
…wxScrolledWindow to show all content on small screens (e.g. 1024x768).

This fixes BOINC#1872.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
  • Loading branch information
AenBleidd committed Sep 29, 2022
1 parent 373bcff commit 6b77379
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions clientgui/DlgAdvPreferencesBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri

dialogSizer->Fit( this );
this->SetSizer( dialogSizer );
m_panelProcessor->SetVirtualSize(notebookSizer->GetMinSize());
}

#define PAD0 1
Expand Down Expand Up @@ -268,14 +269,14 @@ void CDlgAdvPreferencesBase::addNewRowToSizer(
toSizer->Add( rowSizer, 0, 0, 1 );
}

wxPanel* CDlgAdvPreferencesBase::createProcessorTab(wxNotebook* notebook) {
wxScrolledWindow* CDlgAdvPreferencesBase::createProcessorTab(wxNotebook* notebook) {
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
wxASSERT(pSkinAdvanced);

wxSize textCtrlSize = getTextCtrlSize(wxT("999.99"));

wxPanel* processorTab = new wxPanel( notebook, ID_TABPAGE_PROC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
processorTab->SetExtraStyle( wxWS_EX_VALIDATE_RECURSIVELY );
wxScrolledWindow* processorTab = new wxScrolledWindow( notebook, ID_TABPAGE_PROC, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxVSCROLL );
processorTab->SetScrollRate(0, 5);

wxBoxSizer* processorTabSizer = new wxBoxSizer( wxVERTICAL );

Expand Down Expand Up @@ -612,7 +613,6 @@ wxPanel* CDlgAdvPreferencesBase::createProcessorTab(wxNotebook* notebook) {

processorTab->SetSizer( processorTabSizer );
processorTab->Layout();
processorTabSizer->Fit( processorTab );

return processorTab;
}
Expand Down Expand Up @@ -1203,4 +1203,3 @@ void CDlgAdvPreferencesBase::makeStaticBoxLabelItalic(wxStaticBox* staticBox) {
staticBox->SetOwnFont(myFont);
#endif
}

12 changes: 6 additions & 6 deletions clientgui/DlgAdvPreferencesBase.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2015 University of California
// Copyright (C) 2022 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -35,7 +35,7 @@
#endif

#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/statbmp.h>

Expand Down Expand Up @@ -151,8 +151,8 @@ class CDlgAdvPreferencesBase : public wxDialog {

// Computing panel
//
wxScrolledWindow* m_panelProcessor;
// In-use items
wxPanel* m_panelProcessor;
wxTextCtrl* m_txtProcIdleFor;
wxCheckBox* m_chkProcInUse;
wxCheckBox* m_chkGPUProcInUse;
Expand Down Expand Up @@ -257,12 +257,12 @@ class CDlgAdvPreferencesBase : public wxDialog {
wxCheckBox* m_chkNetSunday;
wxTextCtrl* m_txtNetSundayStart;
wxTextCtrl* m_txtNetSundayStop;

wxPanel* m_panelButtons;
wxButton* m_btnOK;
wxButton* m_btnCancel;
wxButton* m_btnHelp;

wxString *web_prefs_url;
bool m_bUsingLocalPrefs;

Expand All @@ -285,7 +285,7 @@ class CDlgAdvPreferencesBase : public wxDialog {
wxWindow* item4, wxString& tt4,
wxWindow* item5, wxString& tt5
);
wxPanel* createProcessorTab(wxNotebook* notebook);
wxScrolledWindow* createProcessorTab(wxNotebook* notebook);
wxPanel* createNetworkTab(wxNotebook* notebook);
wxPanel* createDiskTab(wxNotebook* notebook);
wxPanel* createDailySchedulesTab(wxNotebook* notebook);
Expand Down

0 comments on commit 6b77379

Please sign in to comment.