aboutsummaryrefslogtreecommitdiff
path: root/docs/GUI_SETTINGS.md
blob: bc892b5aee03b65021dfa1e94c362b9b74ffd1d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# SRDWM GUI Settings Program

## Overview
The SRDWM GUI Settings program provides a user-friendly interface for configuring the window manager without editing Lua files directly. It integrates seamlessly with existing system settings structures on Windows, macOS, and Linux.

## Architecture

### Cross-Platform GUI Framework
- **Linux**: GTK4 with native desktop integration
- **Windows**: WinUI 3 with Windows Settings integration
- **macOS**: SwiftUI with System Preferences integration

### System Integration
- **Windows**: Appears in Windows Settings > System > Window Manager
- **macOS**: Appears in System Preferences > Desktop & Screen Saver > Window Manager
- **Linux**: Appears in GNOME Settings, KDE System Settings, etc.

## Main Interface

### 1. General Settings Tab
```
┌─────────────────────────────────────────────────────────┐
│ General Settings                                        │
├─────────────────────────────────────────────────────────┤
│ Default Layout: [Dynamic ▼]                             │
│ Smart Window Placement: ☑                              │
│ Window Gap: [8] pixels                                 │
│ Border Width: [2] pixels                               │
│ Enable Animations: ☑                                   │
│ Animation Duration: [200] ms                           │
│                                                         │
│ Focus Follows Mouse: ☐                                 │
│ Mouse Follows Focus: ☑                                 │
│ Auto Raise Windows: ☐                                  │
│ Auto Focus Windows: ☑                                  │
└─────────────────────────────────────────────────────────┘
```

### 2. Key Bindings Tab
```
┌─────────────────────────────────────────────────────────┐
│ Key Bindings                                           │
├─────────────────────────────────────────────────────────┤
│ Layout Switching                                       │
│ ├─ Tiling Layout: [Mod4+1] [Change] [Remove]          │
│ ├─ Dynamic Layout: [Mod4+2] [Change] [Remove]         │
│ └─ Floating Layout: [Mod4+3] [Change] [Remove]        │
│                                                         │
│ Window Management                                      │
│ ├─ Close Window: [Mod4+q] [Change] [Remove]           │
│ ├─ Minimize Window: [Mod4+m] [Change] [Remove]        │
│ └─ Maximize Window: [Mod4+f] [Change] [Remove]        │
│                                                         │
│ [Add New Binding]                                      │
└─────────────────────────────────────────────────────────┘
```

### 3. Layouts Tab
```
┌─────────────────────────────────────────────────────────┐
│ Layouts                                                │
├─────────────────────────────────────────────────────────┤
│ Tiling Layout                                          │
│ ├─ Split Ratio: [50]% [Reset]                         │
│ ├─ Master Ratio: [60]% [Reset]                        │
│ ├─ Auto Swap: ☑                                       │
│ └─ Gaps: Inner [8] Outer [16] [Reset]                 │
│                                                         │
│ Dynamic Layout                                         │
│ ├─ Snap Threshold: [50]px [Reset]                     │
│ ├─ Grid Size: [6] [Reset]                             │
│ ├─ Cascade Offset: [30]px [Reset]                     │
│ └─ Smart Placement: ☑                                 │
│                                                         │
│ [Add Custom Layout]                                    │
└─────────────────────────────────────────────────────────┘
```

### 4. Themes Tab
```
┌─────────────────────────────────────────────────────────┐
│ Themes                                                 │
├─────────────────────────────────────────────────────────┤
│ Current Theme: [Nord ▼] [Preview]                     │
│                                                         │
│ Colors                                                 │
│ ├─ Background: [■] #2e3440 [Change]                   │
│ ├─ Foreground: [■] #eceff4 [Change]                   │
│ ├─ Primary: [■] #88c0d0 [Change]                      │
│ └─ Secondary: [■] #81a1c1 [Change]                    │
│                                                         │
│ Window Decorations                                     │
│ ├─ Border Width: [2]px [Reset]                        │
│ ├─ Title Bar Height: [24]px [Reset]                   │
│ └─ Font: [JetBrains Mono 10] [Change]                 │
│                                                         │
│ [Import Theme] [Export Theme] [Create New]             │
└─────────────────────────────────────────────────────────┘
```

### 5. Window Rules Tab
```
┌─────────────────────────────────────────────────────────┐
│ Window Rules                                           │
├─────────────────────────────────────────────────────────┤
│ Rule 1: Firefox → Dynamic Layout                      │
│ ├─ Match: Class = "firefox"                           │
│ ├─ Action: Layout = "dynamic"                         │
│ └─ [Edit] [Delete]                                    │
│                                                         │
│ Rule 2: Terminal → Tiling Layout                      │
│ ├─ Match: Class = "terminal"                          │
│ ├─ Action: Layout = "tiling"                          │
│ └─ [Edit] [Delete]                                    │
│                                                         │
│ [Add New Rule]                                         │
└─────────────────────────────────────────────────────────┘
```

### 6. Performance Tab
```
┌─────────────────────────────────────────────────────────┐
│ Performance                                            │
├─────────────────────────────────────────────────────────┤
│ Graphics                                              │
│ ├─ Enable V-Sync: ☑                                   │
│ ├─ Max FPS: [60] [Reset]                              │
│ └─ Enable Caching: ☑                                  │
│                                                         │
│ Memory                                                 │
│ ├─ Window Cache Size: [100] [Reset]                   │
│ ├─ Event Queue Size: [1000] [Reset]                   │
│ └─ Layout Timeout: [16]ms [Reset]                     │
│                                                         │
│ [Optimize for Performance] [Reset to Defaults]         │
└─────────────────────────────────────────────────────────┘
```

## Key Binding Editor

### Add/Edit Key Binding Dialog
```
┌─────────────────────────────────────────────────────────┐
│ Edit Key Binding                                      │
├─────────────────────────────────────────────────────────┤
│ Key Combination: [Press keys here...]                 │
│ Current: Mod4+Shift+1                                 │
│                                                         │
│ Action Type: [Window Management ▼]                     │
│ Action: [Close Window ▼]                              │
│                                                         │
│ Custom Command: [________________]                     │
│                                                         │
│ [Test Binding] [OK] [Cancel]                          │
└─────────────────────────────────────────────────────────┘
```

### Key Combination Parser
- **Mod4**: Super/Windows key
- **Mod1**: Alt key
- **Mod2**: Num Lock
- **Mod3**: Scroll Lock
- **Shift**: Shift key
- **Ctrl**: Control key

## Theme Editor

### Color Picker Integration
```
┌─────────────────────────────────────────────────────────┐
│ Color Picker                                           │
├─────────────────────────────────────────────────────────┤
│ Color: [■] #88c0d0                                    │
│                                                         │
│ RGB: R [136] G [192] B [208]                          │
│ HSV: H [199] S [35] V [82]                            │
│                                                         │
│ Preset Colors:                                         │
│ [■][■][■][■][■][■][■][■]                              │
│                                                         │
│ [Pick from Screen] [OK] [Cancel]                      │
└─────────────────────────────────────────────────────────┘
```

### Font Selector
```
┌─────────────────────────────────────────────────────────┐
│ Font Selection                                         │
├─────────────────────────────────────────────────────────┤
│ Font Family: [JetBrains Mono ▼]                       │
│ Font Size: [10] [Reset]                               │
│ Font Weight: [Normal ▼]                               │
│ Font Style: [Normal ▼]                                │
│                                                         │
│ Preview: The quick brown fox jumps over the lazy dog   │
│                                                         │
│ [OK] [Cancel]                                          │
└─────────────────────────────────────────────────────────┘
```

## System Integration

### Windows Integration
```cpp
// Windows Settings integration
class WindowsSettingsIntegration {
public:
    void register_with_settings();
    void create_settings_page();
    void handle_settings_changes();
    
private:
    void add_to_windows_settings();
    void create_registry_entries();
    void register_protocol_handler();
};
```

### macOS Integration
```swift
// macOS System Preferences integration
class MacOSSettingsIntegration: NSObject {
    func registerWithSystemPreferences()
    func createPreferencesPane()
    func handlePreferencesChanges()
    
    private func addToSystemPreferences()
    func createPreferencePaneBundle()
    func registerURLScheme()
}
```

### Linux Integration
```cpp
// Linux desktop integration
class LinuxDesktopIntegration {
public:
    void register_with_desktop();
    void create_settings_app();
    void handle_settings_changes();
    
private:
    void add_to_gnome_settings();
    void add_to_kde_settings();
    void create_desktop_file();
    void register_mime_types();
};
```

## Configuration Management

### Auto-Save and Validation
```cpp
class ConfigurationManager {
public:
    void auto_save_changes();
    bool validate_configuration();
    void backup_configuration();
    void restore_configuration();
    
private:
    void save_to_lua_files();
    void validate_lua_syntax();
    void create_backup();
    void notify_user_of_changes();
};
```

### Import/Export
```cpp
class ConfigurationIO {
public:
    bool import_configuration(const std::string& path);
    bool export_configuration(const std::string& path);
    bool import_from_other_wm(const std::string& wm_name);
    
private:
    void parse_import_format();
    void convert_to_srdwm_format();
    void validate_imported_config();
};
```

## Advanced Features

### Live Preview
- **Real-time updates**: Changes apply immediately
- **Window preview**: See how windows will look
- **Layout preview**: Visualize layout changes
- **Theme preview**: Live theme switching

### Configuration Sync
- **Cloud sync**: Sync settings across devices
- **Version control**: Track configuration changes
- **Backup/restore**: Automatic configuration backups
- **Migration tools**: Import from other window managers

### Accessibility
- **High contrast**: High contrast mode support
- **Screen reader**: Full screen reader compatibility
- **Keyboard navigation**: Complete keyboard navigation
- **Large text**: Scalable interface elements

## Installation and Distribution

### Package Integration
```bash
# Linux (Debian/Ubuntu)
sudo apt install srdwm-settings

# Linux (Arch)
sudo pacman -S srdwm-settings

# Windows (Chocolatey)
choco install srdwm-settings

# macOS (Homebrew)
brew install srdwm-settings
```

### System Integration
```bash
# Linux desktop files
~/.local/share/applications/srdwm-settings.desktop

# Windows registry
HKEY_CURRENT_USER\Software\SRDWM\Settings

# macOS preferences
~/Library/Preferences/com.srdwm.settings.plist
```

## Development

### Building the GUI
```bash
# Linux (GTK4)
meson build -Dgui=true
ninja -C build

# Windows (WinUI 3)
dotnet build src/gui/SRDWM.Settings.Windows

# macOS (SwiftUI)
xcodebuild -project src/gui/SRDWM.Settings.macOS.xcodeproj
```

### Testing
```bash
# Unit tests
ninja -C build test

# Integration tests
ninja -C build integration-test

# GUI tests
ninja -C build gui-test
```

## User Experience

### First Run Experience
1. **Welcome dialog**: Introduction to SRDWM
2. **Quick setup**: Essential settings configuration
3. **Tutorial**: Interactive configuration guide
4. **Import options**: Import from existing setups

### Contextual Help
- **Tooltips**: Hover for help text
- **Help button**: Context-sensitive help
- **Documentation**: Integrated user manual
- **Examples**: Sample configurations

### Error Handling
- **Validation**: Real-time configuration validation
- **Error messages**: Clear, actionable error messages
- **Recovery**: Automatic error recovery
- **Logging**: Detailed error logging

This GUI settings program provides a professional, user-friendly interface that integrates seamlessly with existing system structures while maintaining the power and flexibility of the Lua configuration system.