Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setupwizard: Use Gtk::Grid instead of Gtk::Table #472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 23 additions & 15 deletions src/setupwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ void PageNet::slot_setup_browser()

PageFont::PageFont() : Gtk::VBox(),
m_label( "3/5.フォントの設定をします", Gtk::ALIGN_START ),
m_table( 2, 4 ),
m_label_res( "スレ(_T)", Gtk::ALIGN_START, Gtk::ALIGN_START, true ),
m_label_mail( "メール(_U)", Gtk::ALIGN_START, Gtk::ALIGN_START, true ),
m_label_popup( "ポップアップ(_P)", Gtk::ALIGN_START, Gtk::ALIGN_START, true ),
m_label_tree( "板/スレ一覧(_O)", Gtk::ALIGN_START, Gtk::ALIGN_START, true ),
m_label_res( "スレ(_T)", Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true ),
m_label_mail( "メール(_U)", Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true ),
m_label_popup( "ポップアップ(_P)", Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true ),
m_label_tree( "板/スレ一覧(_O)", Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true ),
m_font_res( "スレフォント" ),
m_font_mail( "メール欄フォント" ),
m_font_popup( "ポップアップフォント" ),
Expand All @@ -136,16 +135,25 @@ PageFont::PageFont() : Gtk::VBox(),
m_font_popup.signal_font_set().connect( sigc::mem_fun( *this, &PageFont::slot_font_popup ) );
m_font_tree.signal_font_set().connect( sigc::mem_fun( *this, &PageFont::slot_font_tree ) );

m_table.set_spacings( 4 );
m_table.attach( m_label_res, 0, 1, 0, 1, Gtk::FILL, Gtk::SHRINK );
m_table.attach( m_label_mail, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK );
m_table.attach( m_label_popup, 0, 1, 2, 3, Gtk::FILL, Gtk::SHRINK );
m_table.attach( m_label_tree, 0, 1, 3, 4, Gtk::FILL, Gtk::SHRINK );

m_table.attach( m_font_res, 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK );
m_table.attach( m_font_mail, 1, 2, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK );
m_table.attach( m_font_popup, 1, 2, 2, 3, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK );
m_table.attach( m_font_tree, 1, 2, 3, 4, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK );
m_font_res.set_hexpand( true );
m_font_mail.set_hexpand( true );
m_font_popup.set_hexpand( true );
m_font_tree.set_hexpand( true );

m_table.set_row_spacing( 4 );
m_table.set_column_spacing( 4 );
m_table.set_hexpand( true );
constexpr int width = 1;
constexpr int height = 1;
m_table.attach( m_label_res, 0, 0, width, height );
m_table.attach( m_label_mail, 0, 1, width, height );
m_table.attach( m_label_popup, 0, 2, width, height );
m_table.attach( m_label_tree, 0, 3, width, height );

m_table.attach( m_font_res, 1, 0, width, height );
m_table.attach( m_font_mail, 1, 1, width, height );
m_table.attach( m_font_popup, 1, 2, width, height );
m_table.attach( m_font_tree, 1, 3, width, height );
Comment on lines +146 to +156
Copy link
Collaborator Author

@ma8ma ma8ma Sep 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コンパイルエラーの原因 (https://github.com/JDimproved/JDim/runs/1169393326)

gtkmm 3.22 の Gtk::Grid::attach() にはデフォルト引数が設定されていない。
https://developer.gnome.org/gtkmm/3.22/classGtk_1_1Grid.html#a9c425e95660daff60a77fc0cafc18115


set_spacing( SPACING_SIZE );
pack_start( m_hbox_label, Gtk::PACK_SHRINK );
Expand Down
2 changes: 1 addition & 1 deletion src/setupwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace CORE
Gtk::Image m_icon;
Gtk::Label m_label;

Gtk::Table m_table;
Gtk::Grid m_table;

Gtk::Label m_label_res;
Gtk::Label m_label_mail;
Expand Down