2022-07-15 15:37:19 +00:00
# include "libslic3r/libslic3r.h"
# include "KBShortcutsDialog.hpp"
# include "I18N.hpp"
# include "libslic3r/Utils.hpp"
# include "GUI.hpp"
# include "Notebook.hpp"
# include <wx/scrolwin.h>
# include <wx/display.h>
# include "GUI_App.hpp"
# include "wxExtensions.hpp"
# include "MainFrame.hpp"
# include <wx/notebook.h>
namespace Slic3r {
namespace GUI {
wxDEFINE_EVENT ( EVT_PREFERENCES_SELECT_TAB , wxCommandEvent ) ;
KBShortcutsDialog : : KBShortcutsDialog ( )
: DPIDialog ( static_cast < wxWindow * > ( wxGetApp ( ) . mainframe ) , wxID_ANY , _L ( " Keyboard Shortcuts " ) ,
wxDefaultPosition , wxDefaultSize , wxDEFAULT_DIALOG_STYLE )
{
// fonts
const wxFont & font = wxGetApp ( ) . normal_font ( ) ;
const wxFont & bold_font = wxGetApp ( ) . bold_font ( ) ;
SetFont ( font ) ;
std : : string icon_path = ( boost : : format ( " %1%/images/BambuStudioTitle.ico " ) % resources_dir ( ) ) . str ( ) ;
SetIcon ( wxIcon ( encode_path ( icon_path . c_str ( ) ) , wxBITMAP_TYPE_ICO ) ) ;
this - > SetSizeHints ( wxDefaultSize , wxDefaultSize ) ;
this - > SetBackgroundColour ( wxColour ( 255 , 255 , 255 ) ) ;
wxBoxSizer * m_sizer_top = new wxBoxSizer ( wxVERTICAL ) ;
auto m_top_line = new wxPanel ( this , wxID_ANY , wxDefaultPosition , wxSize ( - 1 , 1 ) , wxTAB_TRAVERSAL ) ;
m_top_line - > SetBackgroundColour ( wxColour ( 166 , 169 , 170 ) ) ;
m_sizer_top - > Add ( m_top_line , 0 , wxEXPAND , 0 ) ;
m_sizer_body = new wxBoxSizer ( wxHORIZONTAL ) ;
m_panel_selects = new wxPanel ( this , wxID_ANY , wxDefaultPosition , wxDefaultSize , wxTAB_TRAVERSAL ) ;
m_panel_selects - > SetBackgroundColour ( wxColour ( 248 , 248 , 248 ) ) ;
wxBoxSizer * m_sizer_left = new wxBoxSizer ( wxVERTICAL ) ;
m_sizer_left - > Add ( 0 , 0 , 0 , wxEXPAND | wxTOP , FromDIP ( 20 ) ) ;
m_sizer_left - > Add ( create_button ( 0 , _L ( " Global " ) ) , 0 , wxEXPAND , 0 ) ;
m_sizer_left - > Add ( create_button ( 1 , _L ( " Prepare " ) ) , 0 , wxEXPAND , 0 ) ;
m_sizer_left - > Add ( create_button ( 2 , _L ( " Toolbar " ) ) , 0 , wxEXPAND , 0 ) ;
m_sizer_left - > Add ( create_button ( 3 , _L ( " Objects list " ) ) , 0 , wxEXPAND , 0 ) ;
m_sizer_left - > Add ( create_button ( 4 , _L ( " Preview " ) ) , 0 , wxEXPAND , 0 ) ;
m_panel_selects - > SetSizer ( m_sizer_left ) ;
m_panel_selects - > Layout ( ) ;
m_sizer_left - > Fit ( m_panel_selects ) ;
m_sizer_body - > Add ( m_panel_selects , 0 , wxEXPAND , 0 ) ;
m_sizer_right = new wxBoxSizer ( wxHORIZONTAL ) ;
m_sizer_right - > Add ( 0 , 0 , 0 , wxEXPAND | wxLEFT , FromDIP ( 12 ) ) ;
m_simplebook = new wxSimplebook ( this , wxID_ANY , wxDefaultPosition , wxSize ( FromDIP ( 870 ) , FromDIP ( 500 ) ) , 0 ) ;
m_sizer_right - > Add ( m_simplebook , 1 , wxEXPAND , 0 ) ;
m_sizer_body - > Add ( m_sizer_right , 1 , wxEXPAND , 0 ) ;
m_sizer_top - > Add ( m_sizer_body , 1 , wxEXPAND , 0 ) ;
fill_shortcuts ( ) ;
for ( size_t i = 0 ; i < m_full_shortcuts . size ( ) ; + + i ) {
wxPanel * page = create_page ( m_simplebook , m_full_shortcuts [ i ] , font , bold_font ) ;
m_pages . push_back ( page ) ;
m_simplebook - > AddPage ( page , m_full_shortcuts [ i ] . first . first , i = = 0 ) ;
}
Bind ( EVT_PREFERENCES_SELECT_TAB , & KBShortcutsDialog : : OnSelectTabel , this ) ;
SetSizer ( m_sizer_top ) ;
Layout ( ) ;
Fit ( ) ;
CenterOnParent ( ) ;
// select first
auto event = wxCommandEvent ( EVT_PREFERENCES_SELECT_TAB ) ;
event . SetInt ( 0 ) ;
event . SetEventObject ( this ) ;
wxPostEvent ( this , event ) ;
2022-11-04 03:28:05 +00:00
wxGetApp ( ) . UpdateDlgDarkUI ( this ) ;
2022-07-15 15:37:19 +00:00
}
void KBShortcutsDialog : : OnSelectTabel ( wxCommandEvent & event )
{
2022-11-04 03:28:05 +00:00
auto id = event . GetInt ( ) ;
2022-07-15 15:37:19 +00:00
SelectHash : : iterator i = m_hash_selector . begin ( ) ;
while ( i ! = m_hash_selector . end ( ) ) {
Select * sel = i - > second ;
if ( id = = sel - > m_index ) {
2022-11-04 03:28:05 +00:00
sel - > m_tab_button - > SetBackgroundColour ( StateColor : : darkModeColorFor ( wxColour ( " #FFFFFF " ) ) ) ;
sel - > m_tab_text - > SetBackgroundColour ( StateColor : : darkModeColorFor ( wxColour ( " #FFFFFF " ) ) ) ;
2022-07-15 15:37:19 +00:00
sel - > m_tab_text - > SetFont ( : : Label : : Head_13 ) ;
sel - > m_tab_button - > Refresh ( ) ;
sel - > m_tab_text - > Refresh ( ) ;
m_simplebook - > SetSelection ( id ) ;
} else {
2022-11-04 03:28:05 +00:00
sel - > m_tab_button - > SetBackgroundColour ( StateColor : : darkModeColorFor ( wxColour ( " #F8F8F8 " ) ) ) ;
sel - > m_tab_text - > SetBackgroundColour ( StateColor : : darkModeColorFor ( wxColour ( " #F8F8F8 " ) ) ) ;
2022-07-15 15:37:19 +00:00
sel - > m_tab_text - > SetFont ( : : Label : : Body_13 ) ;
sel - > m_tab_button - > Refresh ( ) ;
sel - > m_tab_text - > Refresh ( ) ;
}
i + + ;
}
2022-11-04 03:28:05 +00:00
wxGetApp ( ) . UpdateDlgDarkUI ( this ) ;
2022-07-15 15:37:19 +00:00
}
wxWindow * KBShortcutsDialog : : create_button ( int id , wxString text )
{
auto tab_button = new wxWindow ( m_panel_selects , wxID_ANY , wxDefaultPosition , wxSize ( FromDIP ( 150 ) , FromDIP ( 28 ) ) , wxTAB_TRAVERSAL ) ;
wxBoxSizer * sizer = new wxBoxSizer ( wxHORIZONTAL ) ;
sizer - > Add ( 0 , 0 , 0 , wxEXPAND | wxLEFT , FromDIP ( 22 ) ) ;
auto stext = new wxStaticText ( tab_button , wxID_ANY , text , wxDefaultPosition , wxDefaultSize , 0 ) ;
stext - > SetFont ( : : Label : : Body_13 ) ;
stext - > SetForegroundColour ( wxColour ( 38 , 46 , 48 ) ) ;
stext - > Wrap ( - 1 ) ;
sizer - > Add ( stext , 1 , wxALIGN_CENTER , 0 ) ;
tab_button - > Bind ( wxEVT_LEFT_DOWN , [ this , id ] ( auto & e ) {
auto event = wxCommandEvent ( EVT_PREFERENCES_SELECT_TAB ) ;
event . SetInt ( id ) ;
event . SetEventObject ( this ) ;
wxPostEvent ( this , event ) ;
} ) ;
stext - > Bind ( wxEVT_LEFT_DOWN , [ this , id ] ( wxMouseEvent & e ) {
auto event = wxCommandEvent ( EVT_PREFERENCES_SELECT_TAB ) ;
event . SetInt ( id ) ;
event . SetEventObject ( this ) ;
wxPostEvent ( this , event ) ;
} ) ;
Select * sel = new Select ;
sel - > m_index = id ;
sel - > m_tab_button = tab_button ;
sel - > m_tab_text = stext ;
m_hash_selector [ sel - > m_index ] = sel ;
tab_button - > SetSizer ( sizer ) ;
tab_button - > Layout ( ) ;
return tab_button ;
}
void KBShortcutsDialog : : on_dpi_changed ( const wxRect & suggested_rect )
{
m_logo_bmp . msw_rescale ( ) ;
m_header_bitmap - > SetBitmap ( m_logo_bmp . bmp ( ) ) ;
msw_buttons_rescale ( this , em_unit ( ) , { wxID_OK } ) ;
Layout ( ) ;
Fit ( ) ;
Refresh ( ) ;
}
void KBShortcutsDialog : : fill_shortcuts ( )
{
const std : : string & ctrl = GUI : : shortkey_ctrl_prefix ( ) ;
const std : : string & alt = GUI : : shortkey_alt_prefix ( ) ;
if ( wxGetApp ( ) . is_editor ( ) ) {
Shortcuts global_shortcuts = {
// File
{ ctrl + " N " , L ( " New Project " ) } ,
{ ctrl + " O " , L ( " Open Project " ) } ,
{ ctrl + " S " , L ( " Save Project " ) } ,
2023-05-31 08:34:54 +00:00
{ ctrl + " Shift+S " , L ( " Save Project as " ) } ,
2022-07-15 15:37:19 +00:00
// File>Import
2023-02-14 02:10:04 +00:00
{ ctrl + " I " , L ( " Import geometry data from STL/STEP/3MF/OBJ/AMF files " ) } ,
// File>Export
{ ctrl + " G " , L ( " Export plate sliced file " ) } ,
// Slice plate
{ ctrl + " R " , L ( " Slice plate " ) } ,
// Send to Print
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ ctrl + " Shift+G " , L ( " Print plate " ) } ,
2023-04-07 08:46:20 +00:00
2022-07-15 15:37:19 +00:00
// Edit
{ ctrl + " X " , L ( " Cut " ) } ,
{ ctrl + " C " , L ( " Copy to clipboard " ) } ,
{ ctrl + " V " , L ( " Paste from clipboard " ) } ,
2022-08-19 06:54:13 +00:00
// Configuration
2024-03-05 06:34:57 +00:00
# ifdef __APPLE__
{ ctrl + " , " , L ( " Preferences " ) } ,
# else
{ ctrl + " P " , L ( " Preferences " ) } ,
# endif
2024-06-13 06:29:14 +00:00
//3Dconnexion control
2024-06-24 07:05:54 +00:00
# ifndef __APPLE__
{ ctrl + " Shift+M " , L ( " Show/Hide 3Dconnexion devices settings dialog " ) } ,
# else
{ ctrl + " M " , L ( " Show/Hide 3Dconnexion devices settings dialog " ) } ,
# endif
2023-10-20 02:04:01 +00:00
// Switch table page
2024-03-05 06:34:57 +00:00
# ifndef __APPLE__
{ ctrl + " Tab " , L ( " Switch tab page " ) } ,
# endif
2022-08-19 06:54:13 +00:00
//DEL
2022-08-05 10:57:52 +00:00
# ifdef __APPLE__
{ " fn+⌫ " , L ( " Delete selected " ) } ,
# else
2023-04-03 04:02:20 +00:00
{ L ( " Del " ) , L ( " Delete selected " ) } ,
2022-08-05 10:57:52 +00:00
# endif
2022-07-15 15:37:19 +00:00
// Help
2024-06-12 09:58:43 +00:00
# ifdef __WINDOWS__
{ " Shift+Alt+? " , L ( " Show keyboard shortcuts list " ) }
# else
{ " Shift+? " , L ( " Show keyboard shortcuts list " ) }
# endif
2022-07-15 15:37:19 +00:00
} ;
m_full_shortcuts . push_back ( { { _L ( " Global shortcuts " ) , " " } , global_shortcuts } ) ;
Shortcuts plater_shortcuts = {
2022-09-07 02:58:30 +00:00
{ L ( " Left mouse button " ) , L ( " Rotate View " ) } ,
{ L ( " Right mouse button " ) , L ( " Pan View " ) } ,
{ L ( " Mouse wheel " ) , L ( " Zoom View " ) } ,
2022-07-15 15:37:19 +00:00
{ " A " , L ( " Arrange all objects " ) } ,
2023-04-03 04:02:20 +00:00
{ L ( " Shift+A " ) , L ( " Arrange objects on selected plates " ) } ,
2022-07-15 15:37:19 +00:00
2022-08-05 10:57:52 +00:00
//{ "R", L("Auto orientates selected objects or all objects.If there are selected objects, it just orientates the selected ones.Otherwise, it will orientates all objects in the project.") },
2023-04-03 04:02:20 +00:00
{ L ( " Shift+R " ) , L ( " Auto orientates selected objects or all objects.If there are selected objects, it just orientates the selected ones.Otherwise, it will orientates all objects in the current disk. " ) } ,
2022-07-15 15:37:19 +00:00
2023-04-03 04:02:20 +00:00
{ L ( " Shift+Tab " ) , L ( " Collapse/Expand the sidebar " ) } ,
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ L ( ctrl + " Any arrow " ) , L ( " Movement in camera space " ) } ,
{ L ( alt + " Left mouse button " ) , L ( " Select a part " ) } ,
{ L ( ctrl + " Left mouse button " ) , L ( " Select multiple objects " ) } ,
2022-07-15 15:37:19 +00:00
{ L ( " Shift+Left mouse button " ) , L ( " Select objects by rectangle " ) } ,
{ L ( " Arrow Up " ) , L ( " Move selection 10 mm in positive Y direction " ) } ,
{ L ( " Arrow Down " ) , L ( " Move selection 10 mm in negative Y direction " ) } ,
{ L ( " Arrow Left " ) , L ( " Move selection 10 mm in negative X direction " ) } ,
{ L ( " Arrow Right " ) , L ( " Move selection 10 mm in positive X direction " ) } ,
{ L ( " Shift+Any arrow " ) , L ( " Movement step set to 1 mm " ) } ,
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ " Esc " , L ( " Deselect all " ) } ,
2022-08-03 09:00:37 +00:00
{ " 1-9 " , L ( " keyboard 1-9: set filament for object/part " ) } ,
{ ctrl + " 0 " , L ( " Camera view - Default " ) } ,
{ ctrl + " 1 " , L ( " Camera view - Top " ) } ,
{ ctrl + " 2 " , L ( " Camera view - Bottom " ) } ,
{ ctrl + " 3 " , L ( " Camera view - Front " ) } ,
{ ctrl + " 4 " , L ( " Camera view - Behind " ) } ,
{ ctrl + " 5 " , L ( " Camera Angle - Left side " ) } ,
{ ctrl + " 6 " , L ( " Camera Angle - Right side " ) } ,
2022-08-19 06:54:13 +00:00
2022-08-03 09:00:37 +00:00
{ ctrl + " A " , L ( " Select all objects " ) } ,
{ ctrl + " D " , L ( " Delete all " ) } ,
{ ctrl + " Z " , L ( " Undo " ) } ,
{ ctrl + " Y " , L ( " Redo " ) } ,
2022-08-05 10:57:52 +00:00
{ " M " , L ( " Gizmo move " ) } ,
{ " S " , L ( " Gizmo scale " ) } ,
{ " R " , L ( " Gizmo rotate " ) } ,
{ " C " , L ( " Gizmo cut " ) } ,
{ " F " , L ( " Gizmo Place face on bed " ) } ,
{ " L " , L ( " Gizmo SLA support points " ) } ,
{ " P " , L ( " Gizmo FDM paint-on seam " ) } ,
2022-08-19 06:54:13 +00:00
2022-07-15 15:37:19 +00:00
} ;
m_full_shortcuts . push_back ( { { _L ( " Plater " ) , " " } , plater_shortcuts } ) ;
Shortcuts gizmos_shortcuts = {
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ " Esc " , L ( " Deselect all " ) } ,
2024-06-12 09:58:43 +00:00
{ ctrl + L ( " Mouse wheel " ) , L ( " Support/Color Painting: adjust pen radius " ) } ,
{ alt + L ( " Mouse wheel " ) , L ( " Support/Color Painting: adjust section position " ) } ,
2022-07-15 15:37:19 +00:00
} ;
m_full_shortcuts . push_back ( { { _L ( " Gizmo " ) , " " } , gizmos_shortcuts } ) ;
Shortcuts object_list_shortcuts = {
{ " 1-9 " , L ( " Set extruder number for the objects and parts " ) } ,
2023-04-03 04:02:20 +00:00
{ L ( " Del " ) , L ( " Delete objects, parts, modifiers " ) } ,
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ " Esc " , L ( " Deselect all " ) } ,
2022-07-15 15:37:19 +00:00
{ ctrl + " C " , L ( " Copy to clipboard " ) } ,
{ ctrl + " V " , L ( " Paste from clipboard " ) } ,
{ ctrl + " X " , L ( " Cut " ) } ,
{ ctrl + " A " , L ( " Select all objects " ) } ,
2023-11-28 06:34:55 +00:00
{ ctrl + " K " , L ( " Clone selected " ) } ,
2022-07-15 15:37:19 +00:00
{ ctrl + " Z " , L ( " Undo " ) } ,
{ ctrl + " Y " , L ( " Redo " ) } ,
{ L ( " Space " ) , L ( " Select the object/part and press space to change the name " ) } ,
{ L ( " Mouse click " ) , L ( " Select the object/part and mouse click to change the name " ) } ,
} ;
m_full_shortcuts . push_back ( { { _L ( " Objects List " ) , " " } , object_list_shortcuts } ) ;
}
Shortcuts preview_shortcuts = {
{ L ( " Arrow Up " ) , L ( " Vertical slider - Move active thumb Up " ) } ,
{ L ( " Arrow Down " ) , L ( " Vertical slider - Move active thumb Down " ) } ,
{ L ( " Arrow Left " ) , L ( " Horizontal slider - Move active thumb Left " ) } ,
{ L ( " Arrow Right " ) , L ( " Horizontal slider - Move active thumb Right " ) } ,
{ " L " , L ( " On/Off one layer mode of the vertical slider " ) } ,
{ L ( " Shift+Any arrow " ) , L ( " Move slider 5x faster " ) } ,
{ L ( " Shift+Mouse wheel " ) , L ( " Move slider 5x faster " ) } ,
ENH: remove unnecessary translation labels
Principles of removal:
1. Don't translate common symbols such as mm/s, °C, etc.,
they are the same in most languages.
2. Don't translate professional terminology, such as CoreXY,
I3, PLA, TPU, HMS, etc.
3. Don't use unicode codes, use symbols instead. Eg. \u2103 -> °C.
Dont' worry, gettext and modern compilers can recognize them.
4. Fix some encoding warnings (don't use GB2312, use UTF-8 instead).
jira: none
Change-Id: Ifa847d4f32a6f8dcba660ae2026ad09fc914c7fb
2023-11-06 07:38:44 +00:00
{ L ( ctrl + " Any arrow " ) , L ( " Move slider 5x faster " ) } ,
{ L ( ctrl + " Mouse wheel " ) , L ( " Move slider 5x faster " ) } ,
2024-06-24 07:05:54 +00:00
2022-07-15 15:37:19 +00:00
} ;
m_full_shortcuts . push_back ( { { _L ( " Preview " ) , " " } , preview_shortcuts } ) ;
}
wxPanel * KBShortcutsDialog : : create_page ( wxWindow * parent , const ShortcutsItem & shortcuts , const wxFont & font , const wxFont & bold_font )
{
wxPanel * main_page = new wxPanel ( parent ) ;
wxBoxSizer * main_sizer = new wxBoxSizer ( wxVERTICAL ) ;
if ( ! shortcuts . first . second . empty ( ) ) {
main_sizer - > AddSpacer ( FromDIP ( 10 ) ) ;
wxBoxSizer * info_sizer = new wxBoxSizer ( wxHORIZONTAL ) ;
info_sizer - > AddStretchSpacer ( ) ;
info_sizer - > Add ( new wxStaticText ( main_page , wxID_ANY , shortcuts . first . second ) , 0 ) ;
info_sizer - > AddStretchSpacer ( ) ;
main_sizer - > Add ( info_sizer , 0 , wxEXPAND ) ;
main_sizer - > AddSpacer ( FromDIP ( 10 ) ) ;
}
2022-08-03 09:00:37 +00:00
int items_count = ( int ) shortcuts . second . size ( ) ;
wxScrolledWindow * scrollable_panel = new wxScrolledWindow ( main_page ) ;
2022-07-15 15:37:19 +00:00
wxGetApp ( ) . UpdateDarkUI ( scrollable_panel ) ;
scrollable_panel - > SetScrollbars ( 20 , 20 , 50 , 50 ) ;
scrollable_panel - > SetInitialSize ( wxSize ( FromDIP ( 850 ) , FromDIP ( 450 ) ) ) ;
2022-08-03 09:00:37 +00:00
wxBoxSizer * scrollable_panel_sizer = new wxBoxSizer ( wxVERTICAL ) ;
wxFlexGridSizer * grid_sizer = new wxFlexGridSizer ( items_count , 2 , FromDIP ( 10 ) , FromDIP ( 20 ) ) ;
for ( int i = 0 ; i < items_count ; + + i ) {
const auto & [ shortcut , description ] = shortcuts . second [ i ] ;
auto key = new wxStaticText ( scrollable_panel , wxID_ANY , _ ( shortcut ) ) ;
2022-11-04 03:28:05 +00:00
key - > SetForegroundColour ( wxColour ( 50 , 58 , 61 ) ) ;
2022-08-03 09:00:37 +00:00
key - > SetFont ( bold_font ) ;
grid_sizer - > Add ( key , 0 , wxALIGN_CENTRE_VERTICAL ) ;
auto desc = new wxStaticText ( scrollable_panel , wxID_ANY , _ ( description ) ) ;
desc - > SetFont ( font ) ;
2022-11-04 03:28:05 +00:00
desc - > SetForegroundColour ( wxColour ( 50 , 58 , 61 ) ) ;
2022-08-03 09:00:37 +00:00
desc - > Wrap ( FromDIP ( 600 ) ) ;
grid_sizer - > Add ( desc , 0 , wxALIGN_CENTRE_VERTICAL ) ;
2022-07-15 15:37:19 +00:00
}
scrollable_panel_sizer - > Add ( grid_sizer , 1 , wxEXPAND | wxALL , FromDIP ( 20 ) ) ;
scrollable_panel - > SetSizer ( scrollable_panel_sizer ) ;
main_sizer - > Add ( scrollable_panel , 1 , wxEXPAND ) ;
main_page - > SetSizer ( main_sizer ) ;
return main_page ;
}
} // namespace GUI
} // namespace Slic3r