mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:27:44 +00:00
GTableView: Make it possible to hide/show columns from a context menu.
Show a context menu when right clicking the headers of a GTableView, and allow the user to hide/show individual columns.
This commit is contained in:
parent
dbf7878998
commit
613c7b9856
4 changed files with 64 additions and 23 deletions
|
@ -3,7 +3,7 @@
|
|||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GMenuItem.h>
|
||||
|
||||
GAction::GAction(const String& text, const String& custom_data, Function<void(const GAction&)> on_activation_callback, GWidget* widget)
|
||||
GAction::GAction(const String& text, const String& custom_data, Function<void(GAction&)> on_activation_callback, GWidget* widget)
|
||||
: on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
, m_custom_data(custom_data)
|
||||
|
@ -11,12 +11,12 @@ GAction::GAction(const String& text, const String& custom_data, Function<void(co
|
|||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const String& text, Function<void(const GAction&)> on_activation_callback, GWidget* widget)
|
||||
GAction::GAction(const String& text, Function<void(GAction&)> on_activation_callback, GWidget* widget)
|
||||
: GAction(text, String(), move(on_activation_callback), widget)
|
||||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const String& text, RetainPtr<GraphicsBitmap>&& icon, Function<void(const GAction&)> on_activation_callback, GWidget* widget)
|
||||
GAction::GAction(const String& text, RetainPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, GWidget* widget)
|
||||
: on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
, m_icon(move(icon))
|
||||
|
@ -24,13 +24,13 @@ GAction::GAction(const String& text, RetainPtr<GraphicsBitmap>&& icon, Function<
|
|||
{
|
||||
}
|
||||
|
||||
GAction::GAction(const String& text, const GShortcut& shortcut, Function<void(const GAction&)> on_activation_callback, GWidget* widget)
|
||||
GAction::GAction(const String& text, const GShortcut& shortcut, Function<void(GAction&)> on_activation_callback, GWidget* widget)
|
||||
: GAction(text, shortcut, nullptr, move(on_activation_callback), widget)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
GAction::GAction(const String& text, const GShortcut& shortcut, RetainPtr<GraphicsBitmap>&& icon, Function<void(const GAction&)> on_activation_callback, GWidget* widget)
|
||||
GAction::GAction(const String& text, const GShortcut& shortcut, RetainPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, GWidget* widget)
|
||||
: on_activation(move(on_activation_callback))
|
||||
, m_text(text)
|
||||
, m_icon(move(icon))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue