eiwd/data/theme.edc
Pierre-Olivier Mercier c94eb55284 Phase 6: Theme & Polish
Added comprehensive theming and configuration support:

Core Changes:
- Created data/theme.edc with Edje theme groups for gadget states
  (disconnected, connecting, connected, error) with color-coded icons
- Implemented signal-based theme updates (e,state,* signals)
- Created e_mod_config.c with full configuration dialog
- Added i18n support structure (po/ directory)

Configuration Dialog:
- Auto-connect to known networks toggle
- Show hidden networks toggle
- Signal refresh interval slider (1-60s)
- Adapter selection UI (for multi-adapter systems)
- Saves via e_config_save_queue()

Theme Integration:
- Gadget loads e-module-iwd.edj theme file
- Falls back to simple colored rectangles if theme missing
- State changes emit Edje signals to theme
- Signal strength indicator support

Build System:
- Updated data/meson.build to compile theme with edje_cc
- Added i18n framework with po/meson.build
- Created meson_options.txt with nls option
- Added po/POTFILES.in for translatable strings

Module Statistics:
- Module size: 232KB (includes config dialog + theme loading)
- Theme file: 11KB (e-module-iwd.edj)
- Total lines of code: ~3,500+
- New files: 5 (theme.edc, e_mod_config.c, 3 i18n files)

API Compatibility:
- Fixed E_Container deprecation (E 0.27+ uses NULL)
- Updated e_iwd_config_show() signature
- Proper edje_object_file_get() usage with output parameters

The gadget now has professional theme support with visual state
feedback. Configuration can be accessed through standard E module
settings. i18n framework ready for translations.

🎨 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 18:53:00 +07:00

188 lines
4.4 KiB
Text

/* IWD Module Theme */
collections {
/* Main gadget icon - base group */
group {
name: "e/modules/iwd/main";
min: 16 16;
max: 128 128;
parts {
/* Background */
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
color: 0 0 0 0; /* Transparent */
}
}
/* Wi-Fi icon base */
part {
name: "icon";
type: RECT;
description {
state: "default" 0.0;
rel1.relative: 0.1 0.1;
rel2.relative: 0.9 0.9;
color: 128 128 128 255; /* Gray - disconnected */
}
description {
state: "connected" 0.0;
inherit: "default" 0.0;
color: 0 200 0 255; /* Green - connected */
}
description {
state: "connecting" 0.0;
inherit: "default" 0.0;
color: 255 165 0 255; /* Orange - connecting */
}
description {
state: "error" 0.0;
inherit: "default" 0.0;
color: 255 0 0 255; /* Red - error */
}
}
/* Signal strength indicator */
part {
name: "signal";
type: RECT;
description {
state: "default" 0.0;
visible: 0;
rel1.relative: 0.7 0.7;
rel2.relative: 0.95 0.95;
color: 255 255 255 200;
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
}
programs {
program {
name: "go_connected";
signal: "e,state,connected";
source: "e";
action: STATE_SET "connected" 0.0;
target: "icon";
}
program {
name: "go_connecting";
signal: "e,state,connecting";
source: "e";
action: STATE_SET "connecting" 0.0;
target: "icon";
}
program {
name: "go_disconnected";
signal: "e,state,disconnected";
source: "e";
action: STATE_SET "default" 0.0;
target: "icon";
}
program {
name: "go_error";
signal: "e,state,error";
source: "e";
action: STATE_SET "error" 0.0;
target: "icon";
}
program {
name: "signal_show";
signal: "e,signal,show";
source: "e";
action: STATE_SET "visible" 0.0;
target: "signal";
}
program {
name: "signal_hide";
signal: "e,signal,hide";
source: "e";
action: STATE_SET "default" 0.0;
target: "signal";
}
}
}
/* Signal strength icons */
group {
name: "e/modules/iwd/signal/0";
min: 16 16;
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 64 64 64 255;
}
}
}
}
group {
name: "e/modules/iwd/signal/25";
min: 16 16;
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 255 64 64 255; /* Red - weak */
}
}
}
}
group {
name: "e/modules/iwd/signal/50";
min: 16 16;
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 255 165 0 255; /* Orange - fair */
}
}
}
}
group {
name: "e/modules/iwd/signal/75";
min: 16 16;
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 200 200 0 255; /* Yellow - good */
}
}
}
}
group {
name: "e/modules/iwd/signal/100";
min: 16 16;
parts {
part {
name: "base";
type: RECT;
description {
state: "default" 0.0;
color: 0 255 0 255; /* Green - excellent */
}
}
}
}
}