game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
PaletteCommand Struct Reference

Represents a single command in the palette. More...

#include <command_palette.h>

Public Member Functions

bool enabled () const
int matchScore (const QString &query) const
bool shouldShow () const

Public Attributes

std::function< void()> action
QString category
QString description
QString icon
QString id
std::function< bool()> isEnabled
std::function< bool()> isVisible
QString label
int priority = 0
QString shortcut

Detailed Description

Represents a single command in the palette.

Commands can be static (always available) or dynamic (context-dependent). Each command has an action callback that executes when selected.

Definition at line 38 of file command_palette.h.

Member Function Documentation

◆ enabled()

bool PaletteCommand::enabled ( ) const
inline

Definition at line 62 of file command_palette.h.

References isEnabled.

◆ matchScore()

int PaletteCommand::matchScore ( const QString & query) const

Definition at line 183 of file command_palette.cpp.

References category, label, and priority.

◆ shouldShow()

bool PaletteCommand::shouldShow ( ) const
inline

Definition at line 56 of file command_palette.h.

References isVisible.

Member Data Documentation

◆ action

std::function<void()> PaletteCommand::action

Definition at line 48 of file command_palette.h.

◆ category

QString PaletteCommand::category

Definition at line 42 of file command_palette.h.

Referenced by matchScore().

◆ description

QString PaletteCommand::description

Definition at line 45 of file command_palette.h.

◆ icon

QString PaletteCommand::icon

Definition at line 44 of file command_palette.h.

◆ id

QString PaletteCommand::id

Definition at line 40 of file command_palette.h.

◆ isEnabled

std::function<bool()> PaletteCommand::isEnabled

Definition at line 49 of file command_palette.h.

Referenced by enabled().

◆ isVisible

std::function<bool()> PaletteCommand::isVisible

Definition at line 50 of file command_palette.h.

Referenced by shouldShow().

◆ label

QString PaletteCommand::label

Definition at line 41 of file command_palette.h.

Referenced by matchScore().

◆ priority

int PaletteCommand::priority = 0

Definition at line 46 of file command_palette.h.

Referenced by matchScore().

◆ shortcut

QString PaletteCommand::shortcut

Definition at line 43 of file command_palette.h.


The documentation for this struct was generated from the following files: