Skip to content

Commit

Permalink
Use Gtk::FontChooserDialog instead of Gtk::FileSelectionDialog on GTK3 (
Browse files Browse the repository at this point in the history
#134)

GTK3版でGtk::FileSelectionDialogがクラッシュする報告があったので
非推奨のウィジェットのかわりにGtk::FontChooserDialogを使うように修正する。

修正にあたり不具合報告をしていただきありがとうございました。
https://mao.5ch.net/test/read.cgi/linux/1551889442/322
  • Loading branch information
ma8ma committed Oct 19, 2019
1 parent 1f84e84 commit 1a45ab5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/menuslots.cpp
Expand Up @@ -48,6 +48,18 @@
using namespace CORE;


namespace {
#if GTKMM_CHECK_VERSION(3,1,16)
struct FontSelectionDialog : public Gtk::FontChooserDialog
{
Glib::ustring get_font_name() const { return get_font(); }
void set_font_name( const Glib::ustring& name ) { set_font( name ); }
};
#else
using FontSelectionDialog = Gtk::FontSelectionDialog;
#endif
} // namespace


//
// URLを開く
Expand Down Expand Up @@ -781,7 +793,7 @@ void Core::slot_setup_button()
//
void Core::slot_changefont_main()
{
Gtk::FontSelectionDialog diag;
FontSelectionDialog diag;
diag.set_font_name( CONFIG::get_fontname( FONT_MAIN ) );
diag.set_title( "スレビューフォント" );
diag.set_transient_for( *CORE::get_mainwindow() );
Expand All @@ -802,7 +814,7 @@ void Core::slot_changefont_main()
//
void Core::slot_changefont_popup()
{
Gtk::FontSelectionDialog diag;
FontSelectionDialog diag;
diag.set_font_name( CONFIG::get_fontname( FONT_POPUP ) );
diag.set_title( "ポップアップフォント" );
diag.set_transient_for( *CORE::get_mainwindow() );
Expand All @@ -819,7 +831,7 @@ void Core::slot_changefont_popup()
//
void Core::slot_changefont_tree()
{
Gtk::FontSelectionDialog diag;
FontSelectionDialog diag;
diag.set_font_name( CONFIG::get_fontname( FONT_BBS ) );
diag.set_title( "板/スレ一覧フォント" );
diag.set_transient_for( *CORE::get_mainwindow() );
Expand Down

0 comments on commit 1a45ab5

Please sign in to comment.