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

BBSListViewBase: Update context menu construction to use Gio::Menu #1003

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jun 18, 2022

サイドバーの右クリックメニューの構築を更新して廃止予定のGtkActionGtkUIManagerのかわりにGActionGtkBuilderGMenuを使った方法にします。
サイドバーの種類によっては使わないメニューがあるため構築を分けることでメモリ使用量を削減します。
合わせて、GTK4で廃止されるGtkMenuへの依存を減らすためメニューラベルにアクセラレーターキーやマウスジェスチャーの表示を追加する処理を削除します。

関連のissue: #977

サイドバーの右クリックメニューの構築を更新して廃止予定の`GtkAction`や
`GtkUIManager`のかわりに`GAction`、`GtkBuilder`、`GMenu`を使った
方法にします。サイドバーの種類によっては使わないメニューがあるため
構築を分けることでメモリ使用量を削減します。合わせて、GTK4で廃止される
`GtkMenu`への依存を減らすためメニューラベルにアクセラレーターキーや
マウスジェスチャーの表示を追加する処理を削除します。
@ma8ma ma8ma added gtk3 GTK3版に関するトピック feature 機能の追加と削除 labels Jun 18, 2022


// GtkBuilderのUI definitionはメニューごとに分けて使うものだけ構築する
namespace {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

UIがここで定義されていますが派生クラスに振り分けるほうがOOPの原則的にはすっきりするかもしれません

popupmenu = id2popupmenu( "/popup_menu_select" );
CONTROL::set_menu_motion( popupmenu );
// アクショングループを作ってビューに登録
m_action_group = Gio::SimpleActionGroup::create();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GTKが一つのActionGroupを複数のwidgetで共有できる仕様ならビューをまとめるクラスに移動できます

@ma8ma ma8ma merged commit 2b3b0d4 into JDimproved:master Jun 18, 2022
@ma8ma ma8ma deleted the bbslist-update-context-menu-construction branch June 18, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 機能の追加と削除 gtk3 GTK3版に関するトピック
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant