Add GNOME UI agent skill
This commit is contained in:
10 files changed
+2059
No files matched your search
@@ -0,0 +1,200 @@
|
||||
---
|
||||
name: designing-gnome-ui
|
||||
description: Design GNOME UIs following Human Interface Guidelines with GTK 4 and libadwaita. Use when designing UI, selecting widgets/patterns, reviewing HIG compliance, or implementing responsive layouts. Covers containers, navigation, controls, feedback, icons, typography. Don't use for backend code, database design, or non-GNOME toolkits like Qt/Electron.
|
||||
license: CC-BY-SA-4.0
|
||||
compatibility: GTK 4.x, libadwaita 1.4+, GNOME 45+
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
version: "1.0.0"
|
||||
category: design
|
||||
last-updated: "2026-10-02"
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# Designing GNOME UI
|
||||
|
||||
Design GNOME UIs that are HIG-compliant, polished, and user-centered.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Designing, implementing, or modifying UI for GNOME apps
|
||||
- Before writing UI code
|
||||
- Reviewing existing UI for HIG compliance
|
||||
- Working with GTK 4/libadwaita
|
||||
- Styling Qt/PySide6 apps for GNOME
|
||||
|
||||
## Reference Files
|
||||
|
||||
Load these as needed:
|
||||
- [gnome-hig-complete.md](gnome-hig-complete.md) — Full HIG reference when doing comprehensive UI review
|
||||
- [gnome-hig-guidelines.md](gnome-hig-guidelines.md) — Core design principles and philosophy
|
||||
- [gnome-patterns-containers.md](gnome-patterns-containers.md) — When selecting window types, dialogs, lists
|
||||
- [gnome-patterns-navigation.md](gnome-patterns-navigation.md) — When designing app navigation flow
|
||||
- [gnome-patterns-controls.md](gnome-patterns-controls.md) — When selecting buttons, entries, switches
|
||||
- [gnome-patterns-feedback.md](gnome-patterns-feedback.md) — When adding toasts, progress, status indicators
|
||||
- [gnome-reference-keyboard.md](gnome-reference-keyboard.md) — When implementing keyboard shortcuts
|
||||
- [libadwaita-features-1.4-plus.md](libadwaita-features-1.4-plus.md) — When using latest libadwaita widgets
|
||||
|
||||
## Core Principle
|
||||
|
||||
No UI code without design decisions. Pattern selection and quality verification happen before implementation.
|
||||
|
||||
## Quality Layers
|
||||
|
||||
1. **Compliance** — follows HIG
|
||||
2. **Polish** — feels premium
|
||||
3. **Rigor** — handles edge cases
|
||||
|
||||
## The Process
|
||||
|
||||
1. **Context** — User goal, app type, constraints (screen size, input)
|
||||
2. **Patterns** — Select containers, navigation, controls, feedback
|
||||
3. **Details** — Typography, spacing, icons, writing style
|
||||
4. **Checklist** — Verify compliance, polish, rigor before code
|
||||
|
||||
## Container Selection
|
||||
|
||||
| Scenario | Widget | Notes |
|
||||
|----------|--------|-------|
|
||||
| App window | `AdwApplicationWindow` + `AdwHeaderBar` | Remember user size, start ~800×600 |
|
||||
| Settings | `AdwPreferencesWindow` | Handles groups, search, subpages |
|
||||
| List of items | `AdwPreferencesGroup` with rows | Boxed list style |
|
||||
| Modal action | `AdwDialog` | For decisions, confirmations |
|
||||
| Primary action | Single button, header bar end | `suggested-action` class |
|
||||
| Destructive action | `destructive-action` class | Requires undo or confirmation |
|
||||
|
||||
## Navigation Selection
|
||||
|
||||
| Structure | Pattern |
|
||||
|-----------|---------|
|
||||
| Single view | None needed |
|
||||
| 2–5 views | `AdwViewSwitcher` in header bar |
|
||||
| Many/dynamic views | `AdwNavigationSplitView` (sidebar) |
|
||||
| Hierarchical | `AdwNavigationView` (drill-down) |
|
||||
| Documents/tabs | `AdwTabBar` + `AdwTabView` |
|
||||
|
||||
## Control Defaults
|
||||
|
||||
| Need | Use | Avoid |
|
||||
|------|-----|-------|
|
||||
| On/Off | `AdwSwitchRow` | Checkbox for settings |
|
||||
| Choose one (few) | `AdwComboRow` | Radio buttons outside dialogs |
|
||||
| Choose one (many) | `AdwComboRow` + search | Long unsearchable dropdowns |
|
||||
| Text input | `AdwEntryRow` | Bare `GtkEntry` |
|
||||
| Multiline text | `GtkTextView` + `card` class | Unstyled text view |
|
||||
| Number | `AdwSpinRow` | Text entry for numbers |
|
||||
| Action in list | `AdwActionRow` + suffix button | Multiple buttons per row |
|
||||
| Search | `GtkSearchBar` + toggle button | Always-visible search box |
|
||||
|
||||
## Feedback Selection
|
||||
|
||||
| Scenario | Widget | Details |
|
||||
|----------|--------|---------|
|
||||
| Action done | `AdwToast` | Short message, optional undo |
|
||||
| Destructive action | `AdwToast` + undo | Prefer over confirmation dialog |
|
||||
| Error (recoverable) | `AdwToast` | Brief, auto-retry silently |
|
||||
| Error (blocking) | `AdwDialog` | Explain problem and required fix |
|
||||
| Persistent state | `AdwBanner` | Offline, degraded mode |
|
||||
| Needs decision | `AdwDialog` | Conflicts, irreversible actions |
|
||||
| Short wait (<5s) | `AdwSpinner` | No progress bar |
|
||||
| Long operation (>30s) | Progress bar + text | "13 of 42 processed" |
|
||||
|
||||
## Iconography Rules
|
||||
|
||||
- **Symbolic icons only** (outline, monochrome) — never full-color in UI
|
||||
- Source from GNOME Icon Library (`icon-library` app)
|
||||
- Header bar: icon-only buttons, always add tooltips
|
||||
- Naming: `action-object-symbolic` (e.g., `list-add-symbolic`)
|
||||
|
||||
| Action | Icon |
|
||||
|--------|------|
|
||||
| Add/New | `list-add-symbolic` |
|
||||
| Delete | `user-trash-symbolic` |
|
||||
| Settings | `emblem-system-symbolic` |
|
||||
| Menu | `open-menu-symbolic` |
|
||||
| Search | `system-search-symbolic` |
|
||||
| Edit | `document-edit-symbolic` |
|
||||
| Back | `go-previous-symbolic` |
|
||||
| Close | `window-close-symbolic` |
|
||||
|
||||
## New in libadwaita 1.6–1.8
|
||||
|
||||
| Need | Widget | Notes |
|
||||
|------|--------|-------|
|
||||
| Exclusive toggles | `AdwToggleGroup` | Replaces multiple `GtkToggleButton` |
|
||||
| Loading indicator | `AdwSpinner` | Works with animations disabled |
|
||||
| Bottom controls | `AdwBottomSheet` | Music player, persistent actions |
|
||||
| Wrapping content | `AdwWrapBox` | Auto-wraps like text |
|
||||
| Inline switching | `AdwInlineViewSwitcher` | For cards, sidebars |
|
||||
| Shortcuts dialog | `AdwShortcutsDialog` | Replaces `GtkShortcutsWindow` |
|
||||
|
||||
## Quality Checklist
|
||||
|
||||
### Layer 1: Compliance
|
||||
- [ ] Correct container type and header bar structure
|
||||
- [ ] Navigation pattern matches content structure
|
||||
- [ ] Standard widgets used (not custom where native exists)
|
||||
- [ ] Symbolic icons from GNOME Icon Library
|
||||
- [ ] Typography uses style classes (`title-1`, `heading`, `body`, `caption`)
|
||||
- [ ] Libadwaita spacing defaults (no custom margins)
|
||||
- [ ] Header capitalization for labels, sentence for descriptions
|
||||
|
||||
### Layer 2: Polish
|
||||
- [ ] Clear visual hierarchy
|
||||
- [ ] Controls and text properly aligned
|
||||
- [ ] Empty states have placeholder page (icon + message + action)
|
||||
- [ ] Loading states show spinner, never frozen UI
|
||||
- [ ] Smooth resize and view transitions
|
||||
|
||||
### Layer 3: Rigor
|
||||
- [ ] All controls keyboard-accessible (Tab, Enter, Space)
|
||||
- [ ] All elements have accessible names
|
||||
- [ ] Works with high contrast (`GTK_THEME=Adwaita:hc`)
|
||||
- [ ] Works with 200% text scaling
|
||||
- [ ] Destructive actions have undo where possible
|
||||
- [ ] Responsive: works at 360px wide, adapts to larger
|
||||
|
||||
## Red Flags — STOP
|
||||
|
||||
- Custom styling where libadwaita has a pattern
|
||||
- Multiple "suggested" or "destructive" buttons per view
|
||||
- Confirmation dialogs for reversible actions (use undo)
|
||||
- Text over images or textured backgrounds
|
||||
- Non-GNOME icons without strong justification
|
||||
- Missing tooltips on icon-only header bar buttons
|
||||
- Generic labels ("OK", "Yes", "No", "Submit")
|
||||
- Frozen UI during operations
|
||||
|
||||
## Accessibility Testing
|
||||
|
||||
```bash
|
||||
# High contrast
|
||||
GTK_THEME=Adwaita:hc ./myapp
|
||||
|
||||
# Screen reader
|
||||
orca &
|
||||
./myapp
|
||||
|
||||
# Keyboard-only: navigate with Tab/Enter/Space
|
||||
```
|
||||
|
||||
## Reference Files
|
||||
|
||||
| Topic | File |
|
||||
|-------|------|
|
||||
| Full HIG guidelines | [gnome-hig-guidelines.md](gnome-hig-guidelines.md) |
|
||||
| Complete HIG reference | [gnome-hig-complete.md](gnome-hig-complete.md) |
|
||||
| Container patterns | [gnome-patterns-containers.md](gnome-patterns-containers.md) |
|
||||
| Navigation patterns | [gnome-patterns-navigation.md](gnome-patterns-navigation.md) |
|
||||
| Control patterns | [gnome-patterns-controls.md](gnome-patterns-controls.md) |
|
||||
| Feedback patterns | [gnome-patterns-feedback.md](gnome-patterns-feedback.md) |
|
||||
| Keyboard shortcuts | [gnome-reference-keyboard.md](gnome-reference-keyboard.md) |
|
||||
| libadwaita 1.4+ features | [libadwaita-features-1.4-plus.md](libadwaita-features-1.4-plus.md) |
|
||||
|
||||
## External Resources
|
||||
|
||||
- [GNOME HIG](https://developer.gnome.org/hig/)
|
||||
- [Libadwaita Docs](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/)
|
||||
- [GTK 4 Docs](https://docs.gtk.org/gtk4/)
|
||||
- [Icon Library App](https://flathub.org/apps/org.gnome.design.IconLibrary)
|
||||
- [App Icon Preview](https://flathub.org/apps/org.gnome.design.AppIconPreview)
|
||||
@@ -0,0 +1,411 @@
|
||||
---
|
||||
name: gnome-hig-complete
|
||||
description: Complete GNOME Human Interface Guidelines with design principles, app icons, typography, colors, and all UI patterns. Use as comprehensive HIG reference. Don't use for implementation code.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME HIG Complete Guidelines Reference
|
||||
|
||||
Comprehensive reference for GNOME Human Interface Guidelines covering all design guidelines and patterns.
|
||||
|
||||
## Design Principles
|
||||
|
||||
### Design for People
|
||||
- Be as inclusive as possible
|
||||
- Accommodate different physical abilities, cultures, device form factors
|
||||
- Require little specialist knowledge
|
||||
|
||||
### Make it Simple
|
||||
- Do one thing and do it well
|
||||
- Don't overwhelm with too many elements at once
|
||||
- Use progressive disclosure
|
||||
- Frequently used actions should be close at hand
|
||||
|
||||
### Reduce User Effort
|
||||
- Automate what can be automated
|
||||
- Minimize steps required for tasks
|
||||
- Reduce information people need to remember
|
||||
- Keep text short and to the point
|
||||
|
||||
### Be Considerate
|
||||
- Anticipate and prevent mistakes
|
||||
- Allow undo instead of asking confirmation
|
||||
- Respect time and attention
|
||||
- Don't interrupt unnecessarily
|
||||
|
||||
## App Naming
|
||||
|
||||
### Guidelines
|
||||
- Short names (1-3 words)
|
||||
- Unique and memorable
|
||||
- Easy to pronounce
|
||||
- Avoid generic terms
|
||||
- Don't include "GNOME" in the name
|
||||
|
||||
### Good Examples
|
||||
- Files, Music, Photos, Calendar
|
||||
- Boxes, Cheese, Polari
|
||||
|
||||
## App Icons
|
||||
|
||||
### Metaphor
|
||||
- Simple, recognizable
|
||||
- Related to app name/function
|
||||
- Avoid unrelated mascots or logos
|
||||
|
||||
### Style
|
||||
- Simple and geometric
|
||||
- 128×128px canvas, visually weighted smaller
|
||||
- Use depth: top surface + front profile
|
||||
- Front profile shaded darker
|
||||
- Use standard color palette
|
||||
|
||||
### Symbolic Icons
|
||||
- Simplified version for small sizes
|
||||
- Same metaphor as full icon
|
||||
- Used at smaller sizes and special contexts
|
||||
|
||||
### Nightly Variant
|
||||
- Distinct variant for nightly/beta builds
|
||||
- App Icon Preview can generate automatically
|
||||
|
||||
## Pointer & Touch
|
||||
|
||||
### Click/Tap
|
||||
- Primary action: single click/tap
|
||||
- Context menu: right-click or long press
|
||||
|
||||
### Drag
|
||||
- Selection, rearranging, resizing
|
||||
- Use visible drag handles
|
||||
|
||||
### Touch Targets
|
||||
- Minimum 48×48px for touch
|
||||
- Adequate spacing between targets
|
||||
|
||||
## Keyboard
|
||||
|
||||
### General
|
||||
- All functionality keyboard accessible
|
||||
- Visible focus indicators
|
||||
- Logical tab order
|
||||
|
||||
### Standard Shortcuts
|
||||
- Ctrl+Q: Quit
|
||||
- Ctrl+W: Close window
|
||||
- Ctrl+S: Save
|
||||
- Ctrl+Z: Undo
|
||||
- Ctrl+Shift+Z: Redo
|
||||
- F1: Help
|
||||
- Ctrl+F: Search
|
||||
|
||||
### Navigation
|
||||
- Tab: Move forward
|
||||
- Shift+Tab: Move backward
|
||||
- Arrow keys: Navigate within containers
|
||||
- Enter/Space: Activate
|
||||
|
||||
## UI Icons
|
||||
|
||||
### Symbolic Icons
|
||||
- Monochrome, outline style
|
||||
- 16×16px grid
|
||||
- Consistent stroke width (2px)
|
||||
- Use GNOME Icon Library
|
||||
|
||||
### Naming
|
||||
- Action format: `verb-noun-symbolic`
|
||||
- Object format: `noun-symbolic`
|
||||
- Examples: `list-add-symbolic`, `folder-symbolic`
|
||||
|
||||
## UI Styling
|
||||
|
||||
### CSS Classes
|
||||
- `suggested-action`: Primary button
|
||||
- `destructive-action`: Dangerous action
|
||||
- `flat`: Flat button
|
||||
- `card`: Card container
|
||||
- `boxed-list`: Boxed list style
|
||||
- `title-1` through `title-4`: Heading sizes
|
||||
- `heading`, `body`, `caption`: Text styles
|
||||
|
||||
### Colors
|
||||
- Use system colors via CSS variables
|
||||
- Don't hardcode colors
|
||||
- Respect dark/light mode
|
||||
|
||||
## Writing Style
|
||||
|
||||
### Voice
|
||||
- Friendly and conversational
|
||||
- Clear and direct
|
||||
- Avoid jargon
|
||||
|
||||
### Capitalization
|
||||
- Header capitalization for labels
|
||||
- Sentence case for descriptions
|
||||
- Don't use ALL CAPS
|
||||
|
||||
### Labels
|
||||
- Be concise
|
||||
- Use action verbs for buttons
|
||||
- Avoid generic labels ("OK", "Cancel")
|
||||
|
||||
## Typography
|
||||
|
||||
### Style Classes
|
||||
| Class | Use |
|
||||
|-------|-----|
|
||||
| `title-1` | Large headings |
|
||||
| `title-2` | Section headings |
|
||||
| `title-3` | Subsection headings |
|
||||
| `title-4` | Minor headings |
|
||||
| `heading` | List headings |
|
||||
| `body` | Body text |
|
||||
| `caption` | Small text, descriptions |
|
||||
| `monospace` | Code |
|
||||
|
||||
### Alignment
|
||||
- Left-align most text
|
||||
- Center titles in dialogs
|
||||
|
||||
## Navigation Guidelines
|
||||
|
||||
### Structure
|
||||
- Flat structure preferred (2-3 levels max)
|
||||
- Consistent navigation placement
|
||||
- Clear back navigation
|
||||
|
||||
### Patterns by Content
|
||||
| Content Type | Pattern |
|
||||
|--------------|---------|
|
||||
| Single view | No navigation needed |
|
||||
| 2-5 views | View switcher |
|
||||
| Many views | Sidebar |
|
||||
| Hierarchical | Drill-down |
|
||||
| Documents | Tabs |
|
||||
|
||||
## Scaling & Adaptiveness
|
||||
|
||||
### Breakpoints
|
||||
- Compact: < 360px
|
||||
- Small: 360-600px
|
||||
- Medium: 600-840px
|
||||
- Large: > 840px
|
||||
|
||||
### Techniques
|
||||
- Fold panels into navigation
|
||||
- Stack horizontal layouts vertically
|
||||
- Hide secondary content
|
||||
- Use `AdwClamp` for content width
|
||||
|
||||
## Accessibility
|
||||
|
||||
### Requirements
|
||||
- All controls keyboard accessible
|
||||
- Visible focus indicators
|
||||
- Sufficient color contrast
|
||||
- Screen reader compatible
|
||||
|
||||
### Testing
|
||||
```bash
|
||||
# High contrast
|
||||
GTK_THEME=Adwaita:hc ./myapp
|
||||
|
||||
# Screen reader
|
||||
orca &
|
||||
./myapp
|
||||
|
||||
# Text scaling
|
||||
gsettings set org.gnome.desktop.interface text-scaling-factor 2.0
|
||||
```
|
||||
|
||||
## Container Patterns
|
||||
|
||||
### Windows
|
||||
- Use `AdwApplicationWindow`
|
||||
- Remember user size preferences
|
||||
- Default size ~800×600
|
||||
|
||||
### Header Bars
|
||||
- Use `AdwHeaderBar`
|
||||
- Title left-aligned
|
||||
- Controls at ends
|
||||
- Icon-only buttons need tooltips
|
||||
|
||||
### Popovers
|
||||
- Use for contextual UI
|
||||
- Auto-close when clicking outside
|
||||
- Arrow points to trigger
|
||||
|
||||
### Boxed Lists
|
||||
- Group related rows
|
||||
- Use `AdwPreferencesGroup`
|
||||
- Rounded corners, slight background
|
||||
|
||||
### Grid Views
|
||||
- Uniform item sizes
|
||||
- Responsive columns
|
||||
- Selection support
|
||||
|
||||
## Navigation Patterns
|
||||
|
||||
### Browsing
|
||||
- Clear location indication
|
||||
- Back button for hierarchy
|
||||
- Breadcrumbs for deep hierarchies
|
||||
|
||||
### View Switchers
|
||||
- `AdwViewSwitcher` in header bar
|
||||
- 2-5 views
|
||||
- Icon + label
|
||||
|
||||
### Tabs
|
||||
- `AdwTabBar` + `AdwTabView`
|
||||
- Closable tabs
|
||||
- Tab overflow handling
|
||||
|
||||
### Sidebars
|
||||
- `AdwNavigationSplitView`
|
||||
- Collapsible on narrow widths
|
||||
- Selection indicator
|
||||
|
||||
### Search
|
||||
- `GtkSearchBar` with toggle button
|
||||
- Highlight matches
|
||||
- Recent searches
|
||||
|
||||
## Control Patterns
|
||||
|
||||
### Buttons
|
||||
- `GtkButton` for actions
|
||||
- `suggested-action` for primary
|
||||
- `destructive-action` for dangerous
|
||||
- Icon-only needs tooltip
|
||||
|
||||
### Menus
|
||||
- `GtkMenuButton` + `GMenu`
|
||||
- Sections for grouping
|
||||
- Keyboard shortcuts shown
|
||||
|
||||
### Switches
|
||||
- `GtkSwitch` or `AdwSwitchRow`
|
||||
- Immediate effect
|
||||
- No "Apply" needed
|
||||
|
||||
### Text Fields
|
||||
- `GtkEntry` or `AdwEntryRow`
|
||||
- Placeholder text
|
||||
- Validation feedback
|
||||
|
||||
### Checkboxes
|
||||
- `GtkCheckButton`
|
||||
- Multiple independent options
|
||||
- Can be indeterminate
|
||||
|
||||
### Radio Buttons
|
||||
- `GtkCheckButton` with group
|
||||
- Mutually exclusive options
|
||||
- One always selected
|
||||
|
||||
### Drop-Downs
|
||||
- `AdwComboRow`
|
||||
- Finite set of options
|
||||
- Search for long lists
|
||||
|
||||
### Sliders
|
||||
- `GtkScale`
|
||||
- Continuous range
|
||||
- Show current value
|
||||
|
||||
### Spin Buttons
|
||||
- `GtkSpinButton` or `AdwSpinRow`
|
||||
- Numeric input with increment/decrement
|
||||
- Min/max bounds
|
||||
|
||||
## Feedback Patterns
|
||||
|
||||
### Notifications
|
||||
- `GNotification` for system
|
||||
- Persistent, clickable
|
||||
- Include action
|
||||
|
||||
### Toasts
|
||||
- `AdwToast`
|
||||
- Temporary, auto-dismiss
|
||||
- Include undo when applicable
|
||||
|
||||
### Banners
|
||||
- `AdwBanner`
|
||||
- Persistent status
|
||||
- Dismiss when resolved
|
||||
|
||||
### Progress Bars
|
||||
- `GtkProgressBar`
|
||||
- Long operations (>30s)
|
||||
- Show percentage or "X of Y"
|
||||
|
||||
### Spinners
|
||||
- `AdwSpinner`
|
||||
- Short waits (<5s)
|
||||
- No progress indication
|
||||
|
||||
### Dialogs
|
||||
- `AdwDialog`
|
||||
- Blocking decisions
|
||||
- Clear actions
|
||||
|
||||
### Placeholder Pages
|
||||
- `AdwStatusPage`
|
||||
- Empty states
|
||||
- Icon + message + action
|
||||
|
||||
### Tooltips
|
||||
- `GtkWidget.set_tooltip_text()`
|
||||
- For icon-only buttons
|
||||
- Brief descriptions
|
||||
|
||||
## Reference
|
||||
|
||||
### Color Palette
|
||||
- Blue: #1c71d8 (accent)
|
||||
- Green: #2ec27e (success)
|
||||
- Yellow: #f5c211 (warning)
|
||||
- Red: #e01b24 (error)
|
||||
- Purple: #9141ac
|
||||
- Orange: #ff7800
|
||||
|
||||
### Standard Keyboard Shortcuts
|
||||
|
||||
| Action | Shortcut |
|
||||
|--------|----------|
|
||||
| Quit | Ctrl+Q |
|
||||
| Close | Ctrl+W |
|
||||
| Save | Ctrl+S |
|
||||
| Save As | Ctrl+Shift+S |
|
||||
| Undo | Ctrl+Z |
|
||||
| Redo | Ctrl+Shift+Z |
|
||||
| Cut | Ctrl+X |
|
||||
| Copy | Ctrl+C |
|
||||
| Paste | Ctrl+V |
|
||||
| Select All | Ctrl+A |
|
||||
| Find | Ctrl+F |
|
||||
| Find Next | Ctrl+G |
|
||||
| Replace | Ctrl+H |
|
||||
| Print | Ctrl+P |
|
||||
| New | Ctrl+N |
|
||||
| Open | Ctrl+O |
|
||||
| Help | F1 |
|
||||
| Fullscreen | F11 |
|
||||
| Preferences | Ctrl+, |
|
||||
| Shortcuts | Ctrl+? |
|
||||
|
||||
## External Resources
|
||||
|
||||
- [GNOME HIG](https://developer.gnome.org/hig/)
|
||||
- [App Icon Preview](https://flathub.org/apps/org.gnome.design.AppIconPreview)
|
||||
- [Icon Library](https://flathub.org/apps/org.gnome.design.IconLibrary)
|
||||
- [Color Palette](https://developer.gnome.org/hig/reference/palette.html)
|
||||
@@ -0,0 +1,198 @@
|
||||
---
|
||||
name: gnome-hig-guidelines
|
||||
description: GNOME Human Interface Guidelines reference for app design principles, visual design, writing style, and accessibility. Use when checking HIG compliance or understanding GNOME design philosophy. Don't use for code implementation details.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME HIG Guidelines
|
||||
|
||||
Source: https://developer.gnome.org/hig/
|
||||
|
||||
## Design Principles
|
||||
|
||||
### Design for People
|
||||
Be inclusive — accommodate different physical abilities, cultures, device form factors. Software should require little specialist knowledge.
|
||||
|
||||
### Make it Simple
|
||||
- Focus on one situation, one experience
|
||||
- Use progressive disclosure
|
||||
- Frequently used actions close at hand
|
||||
|
||||
### Reduce User Effort
|
||||
- Automate what can be automated
|
||||
- Minimize steps for tasks
|
||||
- Keep text short
|
||||
|
||||
### Be Considerate
|
||||
- Anticipate and prevent mistakes
|
||||
- Prefer undo over confirmation dialogs
|
||||
- Don't interrupt unnecessarily
|
||||
|
||||
---
|
||||
|
||||
## App Naming
|
||||
|
||||
**Good names:**
|
||||
- 1–2 simple nouns
|
||||
- Related to app domain
|
||||
- <15 characters
|
||||
- Easy to pronounce
|
||||
- Header capitalization
|
||||
|
||||
**Avoid:**
|
||||
- Trademarks/other project names
|
||||
- "G" prefix
|
||||
- Acronyms, puns
|
||||
- Non-standard punctuation
|
||||
|
||||
---
|
||||
|
||||
## App Icons
|
||||
|
||||
- Simple, recognizable metaphor related to app name
|
||||
- 128×128px canvas, visual weight matches other icons
|
||||
- Simple geometric style with subtle depth (top + front profile)
|
||||
- Use standard color palette
|
||||
- Also create symbolic version (16×16 monochrome)
|
||||
- Tool: App Icon Preview app
|
||||
|
||||
---
|
||||
|
||||
## UI Icons
|
||||
|
||||
**Style:** Symbolic (simple, monochrome, 16×16px SVG)
|
||||
- Can scale to 32, 64, 128px
|
||||
- Source: Icon Library app or GTK built-ins
|
||||
|
||||
**Usage:**
|
||||
- Icon OR label, not both (exceptions: sidebars, view switchers)
|
||||
- Only use recognized icons (search, menu, back, forward, share)
|
||||
- Some icons need context (stop needs play/pause nearby)
|
||||
|
||||
**Creation:**
|
||||
- 16×16 with margin
|
||||
- 2px strokes (avoid 1px)
|
||||
- Align to pixel grid
|
||||
- Test color inversion
|
||||
|
||||
---
|
||||
|
||||
## UI Styling
|
||||
|
||||
**Adwaita:** Light and dark styles.
|
||||
|
||||
- Most apps: light default, follow system preference
|
||||
- Visual content apps: dark default acceptable
|
||||
- Per-app preference: light, dark, follow system
|
||||
|
||||
**High Contrast:** Test with `GTK_THEME=Adwaita:hc`
|
||||
|
||||
**Custom Styling:**
|
||||
- Minimize — use existing style classes/CSS variables
|
||||
- Never use color alone to convey information
|
||||
- Avoid flashing/blinking
|
||||
|
||||
---
|
||||
|
||||
## Writing Style
|
||||
|
||||
**General:** Short, neutral tone. Avoid "you"/"my".
|
||||
|
||||
**Header Capitalization** (headings, buttons, menus, tooltips):
|
||||
- Capitalize 4+ letter words, all verbs/nouns, first/last word
|
||||
- Example: "Find and Replace"
|
||||
|
||||
**Sentence Capitalization** (checkboxes, radio labels, body text):
|
||||
- First word + proper nouns only
|
||||
|
||||
**Ellipses (…):** When further input needed: "Save As…"
|
||||
**Periods:** Don't end text with periods (except multi-sentence paragraphs)
|
||||
|
||||
---
|
||||
|
||||
## Typography
|
||||
|
||||
**Font:** System default (Adwaita Sans). Never text over textured backgrounds.
|
||||
|
||||
| Style | CSS Class | Use |
|
||||
|-------|-----------|-----|
|
||||
| Body | `body` | Default text |
|
||||
| Heading | `heading` | Titles, group headings |
|
||||
| Caption | `caption` | Sub-text |
|
||||
| Title 1–4 | `title-1` to `title-4` | Display headings |
|
||||
|
||||
**Unicode:** Use proper quotes ""'', multiplication ×, ellipsis …, en-dash –
|
||||
|
||||
---
|
||||
|
||||
## Keyboard
|
||||
|
||||
**Shortcuts:**
|
||||
- Use standard GNOME shortcuts
|
||||
- Ctrl+letter preferred
|
||||
- Shift+Ctrl for reverse/extend
|
||||
- Avoid Alt (access keys) and Super (system)
|
||||
|
||||
**Access Keys:** Alt+underlined letter for all labelled controls
|
||||
|
||||
**Navigation:** Tab/Shift+Tab, Return (activate), Space (toggle), Esc (close transient)
|
||||
|
||||
---
|
||||
|
||||
## Pointer & Touch
|
||||
|
||||
- Large click targets
|
||||
- Don't rely on hover
|
||||
- Primary click: activate/select
|
||||
- Secondary click: context menu only
|
||||
- Esc cancels drag operations
|
||||
- 3/4 finger gestures reserved for system
|
||||
|
||||
**Scrolling:**
|
||||
| | Mouse | Touchpad | Touch |
|
||||
|---|-------|----------|-------|
|
||||
| Scroll | Wheel | 2-finger | 1-finger |
|
||||
| Zoom | Ctrl+wheel | Pinch | Pinch |
|
||||
|
||||
---
|
||||
|
||||
## Navigation
|
||||
|
||||
**Flat:** View switchers (3–5 views), sidebars (many views)
|
||||
**Hierarchical:** Parent → sub-views with back button
|
||||
**Combined:** Flat top-level + hierarchical below
|
||||
|
||||
- Each view: clear focus, easy to digest
|
||||
- Max 1 level hierarchy depth
|
||||
- Support standard keyboard shortcuts
|
||||
|
||||
---
|
||||
|
||||
## Scaling & Adaptiveness
|
||||
|
||||
**Adaptive:** Scale from 360×294px (phone) to large desktop.
|
||||
|
||||
- Design smallest first, then scale up
|
||||
- Use established patterns (view switchers, lists)
|
||||
- Lists scale well
|
||||
- Use breakpoints for layout changes
|
||||
- Smooth resize without glitches
|
||||
|
||||
**Minimum:** Desktop 1024×600px, Phone 360×294px
|
||||
**Large:** Use max-width containers
|
||||
|
||||
---
|
||||
|
||||
## Accessibility
|
||||
|
||||
**Testing:**
|
||||
1. High contrast: `GTK_THEME=Adwaita:hc`
|
||||
2. Large text (Accessibility settings)
|
||||
3. Keyboard-only navigation
|
||||
4. Screen reader (Orca)
|
||||
5. On-screen keyboard
|
||||
|
||||
All elements need descriptive accessible names.
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
name: gnome-patterns-containers
|
||||
description: GNOME container patterns including windows, header bars, popovers, dialogs, and boxed lists. Use when implementing window structure or container widgets. Don't use for navigation or control widgets.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME Patterns: Containers
|
||||
|
||||
## Windows
|
||||
|
||||
### Primary Windows
|
||||
- Main app functionality
|
||||
- Independent (closing one doesn't close others)
|
||||
- Resizable, appropriate default size
|
||||
- Ctrl+W to close
|
||||
|
||||
### Secondary Windows
|
||||
- About, Preferences, Properties
|
||||
- Modal to parent, close with parent
|
||||
- Esc to close
|
||||
- Don't stack multiple
|
||||
|
||||
**API:** `AdwApplicationWindow`, `AdwAboutWindow`, `AdwPreferencesWindow`
|
||||
|
||||
---
|
||||
|
||||
## Header Bars
|
||||
|
||||
- Buttons at start (left), heading center, menus at end
|
||||
- Small number of controls
|
||||
- Update content with view/mode changes
|
||||
- Leave blank space for dragging
|
||||
- All controls need tooltips
|
||||
|
||||
**Button Style:**
|
||||
- Icon-only or icon+label (avoid text-only)
|
||||
- No `suggested-action`/`destructive-action` in primary header bars
|
||||
- Group related buttons with spacing (not linked style)
|
||||
|
||||
**API:** `AdwHeaderBar`
|
||||
|
||||
---
|
||||
|
||||
## Popovers
|
||||
|
||||
- Overlaid container opened by button
|
||||
- Small (≤1/3 parent window), low complexity
|
||||
- Esc to close
|
||||
- No Close/Done button needed
|
||||
- Can have heading if purpose unclear
|
||||
|
||||
**API:** `GtkPopover`
|
||||
|
||||
---
|
||||
|
||||
## Utility Panes
|
||||
|
||||
- Vertical panels beside main view
|
||||
- Left if affects main view; right if subordinate
|
||||
- F9 shortcut to toggle
|
||||
- Overlap main view when narrow (use flap)
|
||||
|
||||
**API:** `AdwOverlaySplitView`
|
||||
|
||||
---
|
||||
|
||||
## Boxed Lists
|
||||
|
||||
For small static lists (preferences, recent docs).
|
||||
|
||||
### Predefined Rows
|
||||
|
||||
| Row Type | Use |
|
||||
|----------|-----|
|
||||
| `AdwSwitchRow` | Title, subtitle, switch |
|
||||
| `AdwActionRow` | Title, subtitle, control |
|
||||
| `AdwComboRow` | Dropdown selection |
|
||||
| `AdwEntryRow` | Text entry |
|
||||
| `AdwSpinRow` | Number with +/- |
|
||||
| `AdwExpanderRow` | Expandable content |
|
||||
| `AdwButtonRow` | Clickable action row |
|
||||
|
||||
### Guidelines
|
||||
- Organize semantically, group similar items
|
||||
- Max 1–2 controls per row
|
||||
- Click row background triggers control
|
||||
- Use `go-next-symbolic` for drill-down rows
|
||||
- Min/max width for adaptive scaling
|
||||
|
||||
### Editable Lists
|
||||
- Add button at top or add row at end
|
||||
- Remove button at row end
|
||||
- Drag handles for reordering
|
||||
- Menu fallback for accessibility (move up/down/remove)
|
||||
|
||||
**API:** `GtkListBox` with `.boxed-list` style class
|
||||
|
||||
---
|
||||
|
||||
## Grid Views
|
||||
|
||||
- Unique thumbnails per item
|
||||
- Order by usefulness (often most recent)
|
||||
- Max-width to prevent long rows
|
||||
- Can offer list view alternative
|
||||
- Test at various window sizes
|
||||
|
||||
**API:** `GtkGridView`
|
||||
|
||||
---
|
||||
|
||||
## List & Column Views
|
||||
|
||||
For large/dynamic data with virtual scrolling.
|
||||
|
||||
- Keep rows simple (1–2 elements)
|
||||
- Symbolic icons
|
||||
- Min/max width for adaptive
|
||||
|
||||
**Column Sorting:**
|
||||
- Down arrow = natural order (A-Z, oldest first)
|
||||
- Up arrow = reverse order
|
||||
|
||||
**API:** `GtkListView`, `GtkColumnView`
|
||||
|
||||
---
|
||||
|
||||
## Selection & Edit Modes
|
||||
|
||||
### Selection Mode
|
||||
For bulk operations on large collections.
|
||||
|
||||
- Checkbox on hover, click toggles selection
|
||||
- When items selected:
|
||||
- Header shows count + cancel button
|
||||
- Action bar at bottom with available actions
|
||||
- Use when ≥3 actions available
|
||||
|
||||
### Edit Mode
|
||||
For distinct editing tasks (playlist editing).
|
||||
|
||||
- Triggered by edit button
|
||||
- "Done" button to exit
|
||||
- Actions shown inline on items
|
||||
|
||||
**API:** `GtkActionBar`, `.selection-mode` style class
|
||||
@@ -0,0 +1,158 @@
|
||||
---
|
||||
name: gnome-patterns-controls
|
||||
description: GNOME control patterns including buttons, menus, switches, sliders, text fields, and selection widgets. Use when implementing user input controls. Don't use for navigation or feedback patterns.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME Patterns: Controls
|
||||
|
||||
## Buttons
|
||||
|
||||
- Icon OR label (not both, except header bars)
|
||||
- Imperative verbs, header capitalization
|
||||
- Make invalid buttons insensitive
|
||||
- No double-click/right-click actions
|
||||
|
||||
### Toggle Buttons
|
||||
- Binary modes (set/unset)
|
||||
- Can be linked for option selection
|
||||
|
||||
### Styles
|
||||
| Style | Use |
|
||||
|-------|-----|
|
||||
| `suggested-action` | Affirmative/next step (one per view) |
|
||||
| `destructive-action` | Warning/danger (one per view) |
|
||||
| `pill` | Primary action in open space |
|
||||
| `circular` | Clustered small buttons |
|
||||
|
||||
**API:** `GtkButton`, `GtkToggleButton`
|
||||
|
||||
---
|
||||
|
||||
## Menus
|
||||
|
||||
- 3–12 items; submenus 3–6 items
|
||||
- No nested submenus
|
||||
- Verbs for commands, adjectives for settings
|
||||
- Group similar items
|
||||
- Important items at top/bottom
|
||||
|
||||
### Primary Menu
|
||||
- `open-menu-symbolic` icon
|
||||
- End of header bar
|
||||
- Standard items (bottom group):
|
||||
- Preferences
|
||||
- Keyboard Shortcuts
|
||||
- Help
|
||||
- About App
|
||||
|
||||
### Secondary Menu
|
||||
- View/content-specific actions
|
||||
- Don't duplicate primary menu items
|
||||
|
||||
**API:** `GtkMenuButton`, `GtkPopoverMenu`
|
||||
|
||||
---
|
||||
|
||||
## Switches
|
||||
|
||||
Binary on/off. Preferred over checkboxes.
|
||||
|
||||
- Label with nouns, header capitalization
|
||||
- Access key for keyboard focus
|
||||
- Background color indicates state
|
||||
- Make insensitive if feature unavailable
|
||||
|
||||
**API:** `GtkSwitch`, `AdwSwitchRow`
|
||||
|
||||
---
|
||||
|
||||
## Text Fields
|
||||
|
||||
- Placeholder text OR label (placeholder preferred)
|
||||
- Header capitalization for labels
|
||||
- Size according to expected content
|
||||
- Apply changes on Return or focus loss
|
||||
|
||||
### Validation
|
||||
- Show positive feedback when valid (not negative while editing)
|
||||
- Real-time feedback preferred
|
||||
|
||||
### Features
|
||||
- Password fields: `GtkPasswordEntry`
|
||||
- Suggestions: completion as user types
|
||||
- Tags/tokens for recipients, etc.
|
||||
|
||||
**API:** `GtkEntry`, `GtkTextView`, `AdwEntryRow`
|
||||
|
||||
---
|
||||
|
||||
## Checkboxes
|
||||
|
||||
For non-exclusive options.
|
||||
|
||||
- Use switches when possible for settings
|
||||
- Sentence capitalization
|
||||
- Can have third "inconsistent" state
|
||||
|
||||
**API:** `GtkCheckButton`
|
||||
|
||||
---
|
||||
|
||||
## Radio Buttons
|
||||
|
||||
Mutually exclusive options when all visible.
|
||||
|
||||
- Group related options
|
||||
- One always selected
|
||||
- Sentence capitalization
|
||||
|
||||
**API:** `GtkCheckButton` (in group)
|
||||
|
||||
---
|
||||
|
||||
## Drop-Down Lists
|
||||
|
||||
Single selection from options.
|
||||
|
||||
- Use `AdwComboRow` in lists
|
||||
- Add search for many options
|
||||
- Default to most common/useful option
|
||||
|
||||
**API:** `GtkDropDown`, `AdwComboRow`
|
||||
|
||||
---
|
||||
|
||||
## Sliders
|
||||
|
||||
Continuous value selection.
|
||||
|
||||
- Show current value
|
||||
- Provide keyboard support
|
||||
- Use when precise value less important than relative position
|
||||
|
||||
**API:** `GtkScale`
|
||||
|
||||
---
|
||||
|
||||
## Spin Buttons
|
||||
|
||||
Number entry with increment/decrement.
|
||||
|
||||
- Use for precise numeric input
|
||||
- Can type directly or use +/- buttons
|
||||
|
||||
**API:** `GtkSpinButton`, `AdwSpinRow`
|
||||
|
||||
---
|
||||
|
||||
## Overlaid Controls
|
||||
|
||||
Controls shown over content (video, images).
|
||||
|
||||
- Auto-hide after timeout
|
||||
- Show on hover/tap
|
||||
- Semi-transparent background for contrast
|
||||
@@ -0,0 +1,208 @@
|
||||
---
|
||||
name: gnome-patterns-feedback
|
||||
description: GNOME feedback patterns including notifications, toasts, banners, dialogs, progress indicators, and spinners. Use when implementing user feedback and status communication. Don't use for input controls.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME Patterns: Feedback
|
||||
|
||||
## Notifications
|
||||
|
||||
System-level, shown outside app window.
|
||||
|
||||
**Use for:**
|
||||
- Download/operation finished
|
||||
- New content available
|
||||
- Message received
|
||||
|
||||
**Elements:**
|
||||
| Element | Description |
|
||||
|---------|-------------|
|
||||
| App Icon | Identifies sender app |
|
||||
| Title | Short summary, header capitalization |
|
||||
| Body | Optional extra detail, sentence capitalization |
|
||||
| Default Action | Click dismisses + shows relevant app view |
|
||||
| Actions | Up to 3 buttons |
|
||||
|
||||
**Guidelines:**
|
||||
- Don't over-notify (restrict frequency for high-volume apps)
|
||||
- Remove outdated notifications
|
||||
- Provide option to disable/reduce
|
||||
- Don't rely solely on notifications
|
||||
|
||||
**API:** `GNotification`
|
||||
|
||||
---
|
||||
|
||||
## Toasts
|
||||
|
||||
In-app transient popups.
|
||||
|
||||
**Use for:**
|
||||
- Event feedback within app
|
||||
- Undo after destructive action
|
||||
- Brief messages
|
||||
|
||||
**Guidelines:**
|
||||
- Short title, informal heading style
|
||||
- Optional button (often undo)
|
||||
- Bottom center of window
|
||||
- Transient (auto-dismiss)
|
||||
|
||||
**API:** `AdwToast`
|
||||
|
||||
---
|
||||
|
||||
## Banners
|
||||
|
||||
Persistent strip at top for ongoing states.
|
||||
|
||||
**Use for:**
|
||||
- Offline mode
|
||||
- Read-only document
|
||||
- Degraded functionality
|
||||
|
||||
**Guidelines:**
|
||||
- Title only (short, informal)
|
||||
- Optional action button
|
||||
- Don't use for events (use notifications/toasts)
|
||||
|
||||
**Examples:**
|
||||
- "Metered network — automatic updates paused"
|
||||
- "Unlock to change settings"
|
||||
- "Working offline"
|
||||
|
||||
**API:** `AdwBanner`
|
||||
|
||||
---
|
||||
|
||||
## Progress Bars
|
||||
|
||||
For tasks >30 seconds.
|
||||
|
||||
**The Bar:**
|
||||
- Show proportion complete
|
||||
- Estimate time if possible
|
||||
- "Almost done" if paused at 100%
|
||||
- Activity mode (back/forth) only if estimation impossible
|
||||
|
||||
**Progress Text:**
|
||||
- "13 of 19 images rotated"
|
||||
- "12.1 of 30 MB downloaded"
|
||||
- "About 3 minutes left"
|
||||
|
||||
**Guidelines:**
|
||||
- Single bar for multiple subtasks (usually)
|
||||
- Thin bars for background tasks (bottom of header bar)
|
||||
- Consider pause/cancel buttons for destructive operations
|
||||
- Display inline, close to related content
|
||||
|
||||
**API:** `GtkProgressBar`
|
||||
|
||||
---
|
||||
|
||||
## Spinners
|
||||
|
||||
For tasks >3 seconds but <30 seconds.
|
||||
|
||||
**Guidelines:**
|
||||
- Don't show for very short periods (distracting)
|
||||
- Place close to related UI
|
||||
- Only one spinner at a time (usually)
|
||||
- Add label if clarification needed
|
||||
- Can add progress text for longer waits
|
||||
|
||||
**API:** `GtkSpinner`, `AdwSpinner`
|
||||
|
||||
---
|
||||
|
||||
## Dialogs
|
||||
|
||||
### Alert Dialogs
|
||||
Message + 1–3 response buttons.
|
||||
|
||||
**Confirmation Dialogs:**
|
||||
- Check user wants to proceed
|
||||
- Cancel + action button
|
||||
- Prefer undo over confirmation
|
||||
|
||||
**Error Dialogs:**
|
||||
- Present error message
|
||||
- Often single button to close
|
||||
- Prefer toasts for non-critical errors
|
||||
|
||||
### Action Dialogs
|
||||
Options before action (Print, Save).
|
||||
|
||||
- Header bar with heading
|
||||
- Cancel + action button
|
||||
- Specific verbs ("Save", "Print"), not "OK"
|
||||
- Insensitive action button until required options selected
|
||||
|
||||
### Button Order
|
||||
- Cancel first (left), action last (right)
|
||||
- Return activates affirmative (unless destructive)
|
||||
- Esc activates cancel
|
||||
|
||||
### Guidelines
|
||||
- Never pop up unexpectedly
|
||||
- Always modal to parent window
|
||||
- Focus first expected control on open
|
||||
|
||||
**API:** `AdwAlertDialog`, `AdwDialog`
|
||||
|
||||
---
|
||||
|
||||
## Placeholder Pages
|
||||
|
||||
Fill empty views.
|
||||
|
||||
### Illustration Style
|
||||
- Initial empty state
|
||||
- Colorful graphic
|
||||
- Positive, upbeat text
|
||||
- Can address user directly
|
||||
|
||||
### Symbolic Style
|
||||
- Other empty spaces (empty folder, no results)
|
||||
- Monochrome icon
|
||||
- Neutral tone
|
||||
- Subtle, not attention-grabbing
|
||||
|
||||
**Elements:**
|
||||
- Heading (required): "Empty Folder", "No Results"
|
||||
- Description (optional): "Use the + button to add items"
|
||||
- Action button (optional): `suggested-action` style
|
||||
|
||||
**API:** `AdwStatusPage`
|
||||
|
||||
---
|
||||
|
||||
## Tooltips
|
||||
|
||||
Additional info on hover.
|
||||
|
||||
**When to Use:**
|
||||
- Required for header bar controls
|
||||
- Useful info (full URL, syntax error)
|
||||
- If one control has tooltip, all in container should
|
||||
|
||||
**Guidelines:**
|
||||
- Header capitalization
|
||||
- Short, not sentences
|
||||
- Don't duplicate existing labels
|
||||
- Don't rely on for essential info (not accessible on touch)
|
||||
|
||||
**Standard Tooltips:**
|
||||
| Button | Tooltip |
|
||||
|--------|---------|
|
||||
| Back | Back |
|
||||
| Search | Search (or "Search Documents") |
|
||||
| Primary menu | Main Menu |
|
||||
| Secondary menu | Menu (or "Document Menu") |
|
||||
| New tab | New Tab |
|
||||
|
||||
**API:** `GtkTooltip`
|
||||
@@ -0,0 +1,103 @@
|
||||
---
|
||||
name: gnome-patterns-navigation
|
||||
description: GNOME navigation patterns including view switchers, tabs, sidebars, browsing, and search. Use when implementing app navigation structure. Don't use for container layout or control widgets.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME Patterns: Navigation
|
||||
|
||||
## Browsing
|
||||
|
||||
Hierarchical navigation with back button.
|
||||
|
||||
- Back button top-left (standard position)
|
||||
- Header bar updates with current view
|
||||
- Support standard keyboard shortcuts (Alt+←/→)
|
||||
|
||||
**API:** `AdwNavigationView`
|
||||
|
||||
---
|
||||
|
||||
## View Switchers
|
||||
|
||||
3–5 predefined views.
|
||||
|
||||
- Header capitalization, nouns not verbs
|
||||
- Similar label lengths
|
||||
- Can indicate activity in views
|
||||
- Move to bottom bar when window too narrow
|
||||
|
||||
**API:** `AdwViewSwitcher`, `AdwViewSwitcherBar`
|
||||
|
||||
---
|
||||
|
||||
## Tabs
|
||||
|
||||
For mutable sets (documents, pages, browser tabs).
|
||||
|
||||
- Icon and/or label
|
||||
- Keep labels short, useful part first
|
||||
- Show/hide tab bar based on app needs
|
||||
|
||||
### Context Menu
|
||||
- Move to New Window (if supported)
|
||||
- Duplicate, Pin/Unpin, Mute, Reload (as needed)
|
||||
- Close (always last)
|
||||
- Avoid left/right references (RTL issues)
|
||||
|
||||
### Keyboard Shortcuts
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+T | New tab |
|
||||
| Ctrl+W | Close tab |
|
||||
| Ctrl+PageUp/Down | Next/Previous tab |
|
||||
| Ctrl+Home/End | First/Last tab |
|
||||
| Alt+1–9 | Switch to tab 1–9 |
|
||||
|
||||
**API:** `AdwTabBar`, `AdwTabView`, `AdwTabOverview`
|
||||
|
||||
---
|
||||
|
||||
## Sidebars
|
||||
|
||||
For many/dynamic locations (messaging, file managers).
|
||||
|
||||
- Order by usefulness (often most recent at top)
|
||||
- Header bar controls above list
|
||||
- Multiple lines of text + images allowed
|
||||
- Avoid for rich/immersive content apps
|
||||
|
||||
**API:** `AdwNavigationSplitView`
|
||||
|
||||
---
|
||||
|
||||
## Search
|
||||
|
||||
Filter content (distinct from find/highlight).
|
||||
|
||||
### Activation
|
||||
1. Type-to-search (typing focuses search)
|
||||
2. Ctrl+F keyboard shortcut
|
||||
3. Search button in header bar (toggles)
|
||||
|
||||
### Search Bar
|
||||
- Slides from under header bar
|
||||
- Hidden until activated (usually)
|
||||
- Can be permanently visible if search is primary function
|
||||
|
||||
### Results
|
||||
- Live filtering as user types
|
||||
- Fast results
|
||||
- "No results" feedback when empty
|
||||
- Show incrementally as collected
|
||||
- Order by relevance
|
||||
|
||||
### Guidelines
|
||||
- Global search across all views (not just current)
|
||||
- Fuzzy matching, tolerate mistakes
|
||||
- Broad matching (city returns country matches)
|
||||
|
||||
**API:** `GtkSearchBar`, `GtkSearchEntry`
|
||||
@@ -0,0 +1,129 @@
|
||||
---
|
||||
name: gnome-reference-keyboard
|
||||
description: Standard GNOME keyboard shortcuts reference for apps. Use when implementing keyboard navigation or checking standard shortcut conventions. Don't use for mouse/touch input patterns.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# GNOME Reference: Keyboard Shortcuts
|
||||
|
||||
## Basic Shortcuts
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+W | Close tab/window |
|
||||
| Ctrl+Q | Quit app |
|
||||
| F1 | Help |
|
||||
| F9 | Toggle utility pane |
|
||||
| F10 | Open menu |
|
||||
| Ctrl+? | Keyboard shortcuts dialog |
|
||||
| Ctrl+, | Preferences |
|
||||
|
||||
## Content & Files
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+N | New |
|
||||
| Ctrl+O | Open |
|
||||
| Ctrl+S | Save |
|
||||
| Shift+Ctrl+S | Save As |
|
||||
| Ctrl+P | Print |
|
||||
| Shift+Ctrl+P | Print Preview |
|
||||
| Ctrl+M | Send/Share |
|
||||
| Alt+Return | Properties |
|
||||
|
||||
## Editing
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+Z | Undo |
|
||||
| Shift+Ctrl+Z | Redo |
|
||||
| Ctrl+X | Cut |
|
||||
| Ctrl+C | Copy |
|
||||
| Ctrl+V | Paste |
|
||||
| Shift+Ctrl+V | Paste Special |
|
||||
| Ctrl+U | Duplicate |
|
||||
| Ctrl+A | Select All |
|
||||
| Shift+Ctrl+A | Deselect All |
|
||||
| Ctrl+F | Find |
|
||||
| Ctrl+G | Find Next |
|
||||
| Shift+Ctrl+G | Find Previous |
|
||||
| Ctrl+H | Replace |
|
||||
|
||||
## View Options
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl++ | Zoom In |
|
||||
| Ctrl+- | Zoom Out |
|
||||
| Ctrl+0 | Normal Size |
|
||||
| Ctrl+R | Reload |
|
||||
| F11 | Fullscreen |
|
||||
|
||||
## Formatting
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+B | Bold |
|
||||
| Ctrl+I | Italic |
|
||||
| Ctrl+U | Underline |
|
||||
|
||||
## Bookmarking
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+D | Add Bookmark |
|
||||
| Ctrl+Alt+D | Edit Bookmarks |
|
||||
|
||||
## Navigation
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Alt+← | Back |
|
||||
| Alt+→ | Forward |
|
||||
| Alt+↑ | Up/Parent |
|
||||
| Alt+Home | Home |
|
||||
| Ctrl+L | Enter Location |
|
||||
| PageUp | Previous Page |
|
||||
| PageDown | Next Page |
|
||||
| Ctrl+Home | First Page |
|
||||
| Ctrl+End | Last Page |
|
||||
|
||||
## Tabs
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| Ctrl+T | New Tab |
|
||||
| Ctrl+W | Close Tab |
|
||||
| Ctrl+PageUp | Previous Tab |
|
||||
| Ctrl+PageDown | Next Tab |
|
||||
| Ctrl+Home | First Tab |
|
||||
| Ctrl+End | Last Tab |
|
||||
| Alt+1–9 | Switch to Tab 1–9 |
|
||||
|
||||
## Standard Navigation Keys
|
||||
|
||||
| Key | Function |
|
||||
|-----|----------|
|
||||
| Tab | Next control |
|
||||
| Shift+Tab | Previous control |
|
||||
| Ctrl+Tab | Next control (when Tab has other function) |
|
||||
| Return | Activate focused control |
|
||||
| Space | Toggle control state |
|
||||
| F10 | Open primary/secondary menu |
|
||||
| Menu/Shift+F10 | Open context menu |
|
||||
| Esc | Close transient container |
|
||||
|
||||
## System Reserved (Avoid in Apps)
|
||||
|
||||
| Shortcut | System Function |
|
||||
|----------|-----------------|
|
||||
| Alt+Tab | Switch windows |
|
||||
| Alt+F4 | Close window |
|
||||
| Alt+F7 | Move window |
|
||||
| Alt+F8 | Resize window |
|
||||
| Alt+Space | Window menu |
|
||||
| Ctrl+Alt+Delete | Power off |
|
||||
| Super+anything | System shortcuts |
|
||||
@@ -0,0 +1,491 @@
|
||||
---
|
||||
name: libadwaita-features-1-4-plus
|
||||
description: Libadwaita 1.4-1.7 new features including AdwDialog, Breakpoints, BottomSheet, Spinner, ButtonRow, MultiLayoutView, accent colors. Use when upgrading apps or using modern libadwaita widgets. Don't use for basic GTK4 widgets.
|
||||
license: CC-BY-SA-4.0
|
||||
metadata:
|
||||
author: Paresh-Maheshwari
|
||||
source: https://github.com/Paresh-Maheshwari/gnome-skills
|
||||
---
|
||||
|
||||
# Libadwaita 1.4–1.7 New Features Reference
|
||||
|
||||
Complete reference for new libadwaita widgets and patterns introduced in versions 1.4 through 1.7.
|
||||
|
||||
## When to Use
|
||||
|
||||
- Upgrading apps to use modern libadwaita features
|
||||
- Choosing between old and new dialog/navigation widgets
|
||||
- Implementing responsive layouts with breakpoints
|
||||
- Using system accent colors in apps
|
||||
- Understanding widget deprecations and migrations
|
||||
|
||||
## Version Summary
|
||||
|
||||
| Version | GNOME | Key Features |
|
||||
|---------|-------|--------------|
|
||||
| 1.4 | 45 | Breakpoints, NavigationView, NavigationSplitView |
|
||||
| 1.5 | 46 | AdwDialog, AdwAlertDialog, AdwPreferencesDialog, AdwAboutDialog |
|
||||
| 1.6 | 47 | BottomSheet, Spinner, ButtonRow, MultiLayoutView, Accent Colors |
|
||||
| 1.7 | 48 | ToggleGroup, WrapBox, InlineViewSwitcher, ShortcutsDialog |
|
||||
|
||||
---
|
||||
|
||||
## Libadwaita 1.4 Features
|
||||
|
||||
### Breakpoint System
|
||||
|
||||
Allows changing UI based on window size without code.
|
||||
|
||||
```xml
|
||||
<object class="AdwBreakpoint">
|
||||
<condition>max-width: 500sp</condition>
|
||||
<setter object="split-view" property="collapsed">True</setter>
|
||||
</object>
|
||||
```
|
||||
|
||||
**Units:**
|
||||
- `px` — Physical pixels
|
||||
- `pt` — Points
|
||||
- `sp` — Scalable pixels (recommended, scales with text size)
|
||||
|
||||
**Key Widgets:**
|
||||
- `AdwWindow` / `AdwApplicationWindow` — Support breakpoints natively
|
||||
- `AdwBreakpointBin` — For more control in specific areas
|
||||
|
||||
**Usage in Code (Python):**
|
||||
```python
|
||||
breakpoint = Adw.Breakpoint.new(Adw.BreakpointCondition.parse("max-width: 500sp"))
|
||||
breakpoint.add_setter(split_view, "collapsed", True)
|
||||
window.add_breakpoint(breakpoint)
|
||||
```
|
||||
|
||||
### AdwNavigationView
|
||||
|
||||
Implements browsing/drill-down pattern with automatic gestures and shortcuts.
|
||||
|
||||
```python
|
||||
nav_view = Adw.NavigationView()
|
||||
|
||||
# Add pages
|
||||
page1 = Adw.NavigationPage(title="Home", child=content1)
|
||||
nav_view.push(page1)
|
||||
|
||||
# Navigate
|
||||
nav_view.push(page2) # Go forward
|
||||
nav_view.pop() # Go back
|
||||
```
|
||||
|
||||
**Features:**
|
||||
- Swipe-back gesture on mobile
|
||||
- Automatic back button
|
||||
- Page transition animations
|
||||
- Can be populated statically from UI files
|
||||
|
||||
### AdwNavigationSplitView
|
||||
|
||||
Sidebar + content pattern that collapses on narrow screens.
|
||||
|
||||
```python
|
||||
split_view = Adw.NavigationSplitView()
|
||||
split_view.set_sidebar(sidebar_widget)
|
||||
split_view.set_content(content_widget)
|
||||
|
||||
# Control collapse
|
||||
split_view.set_collapsed(True) # Force collapsed
|
||||
split_view.set_show_content(True) # Show content (when collapsed)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Libadwaita 1.5 Features
|
||||
|
||||
### AdwDialog (New Dialog System)
|
||||
|
||||
Client-side dialogs that render inside the parent window and become bottom sheets on mobile.
|
||||
|
||||
**Advantages over GtkWindow dialogs:**
|
||||
- Size never exceeds parent window
|
||||
- Swipe-down to close on mobile
|
||||
- Consistent dimming in light/dark modes
|
||||
- Future per-tab dialog support
|
||||
|
||||
**Basic Usage:**
|
||||
```python
|
||||
dialog = Adw.Dialog()
|
||||
dialog.set_title("My Dialog")
|
||||
dialog.set_child(content)
|
||||
dialog.present(parent_widget)
|
||||
```
|
||||
|
||||
**Closing Behavior:**
|
||||
```python
|
||||
# Control whether dialog can close
|
||||
dialog.set_can_close(False) # Prevent closing (unsaved data)
|
||||
|
||||
# Handle close attempt
|
||||
dialog.connect("close-attempt", on_close_attempt)
|
||||
|
||||
# Force close (after confirmation)
|
||||
dialog.force_close()
|
||||
```
|
||||
|
||||
### AdwAlertDialog (Replaces AdwMessageDialog)
|
||||
|
||||
Alert dialogs with response buttons.
|
||||
|
||||
```python
|
||||
dialog = Adw.AlertDialog()
|
||||
dialog.set_heading("Delete File?")
|
||||
dialog.set_body("This cannot be undone.")
|
||||
|
||||
dialog.add_response("cancel", "_Cancel")
|
||||
dialog.add_response("delete", "_Delete")
|
||||
dialog.set_response_appearance("delete", Adw.ResponseAppearance.DESTRUCTIVE)
|
||||
|
||||
dialog.connect("response", on_response)
|
||||
dialog.present(parent)
|
||||
```
|
||||
|
||||
### AdwPreferencesDialog (Replaces AdwPreferencesWindow)
|
||||
|
||||
```python
|
||||
dialog = Adw.PreferencesDialog()
|
||||
|
||||
page = Adw.PreferencesPage()
|
||||
page.set_title("General")
|
||||
page.set_icon_name("preferences-system-symbolic")
|
||||
|
||||
group = Adw.PreferencesGroup()
|
||||
group.set_title("Appearance")
|
||||
page.add(group)
|
||||
|
||||
dialog.add(page)
|
||||
dialog.present(parent)
|
||||
```
|
||||
|
||||
**Differences from AdwPreferencesWindow:**
|
||||
- Search disabled by default
|
||||
- No deprecated subpage API
|
||||
|
||||
### AdwAboutDialog (Replaces AdwAboutWindow)
|
||||
|
||||
```python
|
||||
dialog = Adw.AboutDialog()
|
||||
dialog.set_application_name("My App")
|
||||
dialog.set_application_icon("com.example.myapp")
|
||||
dialog.set_version("1.0.0")
|
||||
dialog.set_developer_name("Developer")
|
||||
dialog.set_developers(["Developer <dev@example.com>"])
|
||||
dialog.set_copyright("© 2026 Developer")
|
||||
dialog.set_license_type(Gtk.License.GPL_3_0)
|
||||
dialog.set_website("https://example.com")
|
||||
dialog.set_issue_url("https://github.com/user/app/issues")
|
||||
dialog.present(parent)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Libadwaita 1.6 Features
|
||||
|
||||
### AdwBottomSheet
|
||||
|
||||
Persistent bottom sheet for music players, controls, etc.
|
||||
|
||||
```python
|
||||
bottom_sheet = Adw.BottomSheet()
|
||||
bottom_sheet.set_content(main_content)
|
||||
bottom_sheet.set_sheet(sheet_content)
|
||||
bottom_sheet.set_open(True)
|
||||
|
||||
# Show as bottom bar (collapsed state)
|
||||
bottom_sheet.set_show_drag_handle(True)
|
||||
```
|
||||
|
||||
**Modes:**
|
||||
- **Open** — Full sheet visible
|
||||
- **Closed** — Only bottom bar visible (if set)
|
||||
- Swipeable between states
|
||||
|
||||
### AdwSpinner
|
||||
|
||||
Modern spinner that works with animations disabled.
|
||||
|
||||
```python
|
||||
spinner = Adw.Spinner()
|
||||
# That's it! No need to set spinning=True
|
||||
|
||||
# For use in images/paintables
|
||||
paintable = Adw.SpinnerPaintable.new(widget)
|
||||
image = Gtk.Image.new_from_paintable(paintable)
|
||||
```
|
||||
|
||||
**Advantages over GtkSpinner:**
|
||||
- Works when animations disabled
|
||||
- Max size 64×64 (no giant spinners)
|
||||
- Better visuals at large sizes
|
||||
- No need to manually start/stop
|
||||
|
||||
### AdwButtonRow
|
||||
|
||||
List row that looks like a button.
|
||||
|
||||
```python
|
||||
row = Adw.ButtonRow()
|
||||
row.set_title("Add Item")
|
||||
row.set_start_icon_name("list-add-symbolic")
|
||||
row.connect("activated", on_add_clicked)
|
||||
|
||||
# Destructive style
|
||||
delete_row = Adw.ButtonRow()
|
||||
delete_row.set_title("Delete All")
|
||||
delete_row.add_css_class("destructive-action")
|
||||
```
|
||||
|
||||
**For separate (non-linked) rows:**
|
||||
```python
|
||||
group = Adw.PreferencesGroup()
|
||||
group.set_separate_rows(True) # Or use .boxed-list-separate class
|
||||
```
|
||||
|
||||
### AdwMultiLayoutView
|
||||
|
||||
Automatically reparent widgets between different layouts.
|
||||
|
||||
```xml
|
||||
<object class="AdwMultiLayoutView" id="multi_layout">
|
||||
<child>
|
||||
<object class="AdwLayout" id="desktop_layout">
|
||||
<property name="name">desktop</property>
|
||||
<property name="content">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="AdwLayoutSlot">
|
||||
<property name="id">sidebar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwLayoutSlot">
|
||||
<property name="id">content</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwLayout" id="mobile_layout">
|
||||
<property name="name">mobile</property>
|
||||
<!-- Different arrangement -->
|
||||
</object>
|
||||
</child>
|
||||
<child type="sidebar">
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Sidebar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="content">
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Content</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
```
|
||||
|
||||
```python
|
||||
# Switch layouts
|
||||
multi_layout.set_layout_name("mobile")
|
||||
multi_layout.set_layout_name("desktop")
|
||||
```
|
||||
|
||||
### System Accent Colors
|
||||
|
||||
Apps automatically follow system accent color.
|
||||
|
||||
**Reading System Accent:**
|
||||
```python
|
||||
style_manager = Adw.StyleManager.get_default()
|
||||
|
||||
# Get accent color enum
|
||||
accent = style_manager.get_accent_color() # AdwAccentColor
|
||||
|
||||
# Get as RGBA
|
||||
rgba = Adw.AccentColor.to_rgba(accent)
|
||||
|
||||
# Get standalone color (for text on white/dark backgrounds)
|
||||
standalone = Adw.AccentColor.to_standalone_rgba(accent)
|
||||
|
||||
# React to changes
|
||||
style_manager.connect("notify::accent-color", on_accent_changed)
|
||||
```
|
||||
|
||||
**Available Colors:**
|
||||
- `ADW_ACCENT_COLOR_BLUE` (default)
|
||||
- `ADW_ACCENT_COLOR_TEAL`
|
||||
- `ADW_ACCENT_COLOR_GREEN`
|
||||
- `ADW_ACCENT_COLOR_YELLOW`
|
||||
- `ADW_ACCENT_COLOR_ORANGE`
|
||||
- `ADW_ACCENT_COLOR_RED`
|
||||
- `ADW_ACCENT_COLOR_PINK`
|
||||
- `ADW_ACCENT_COLOR_PURPLE`
|
||||
- `ADW_ACCENT_COLOR_SLATE`
|
||||
|
||||
**CSS Variables:**
|
||||
```css
|
||||
/* Use specific accent colors */
|
||||
.my-widget {
|
||||
background: var(--accent-purple);
|
||||
}
|
||||
|
||||
/* Override accent for specific widget */
|
||||
.custom-accent {
|
||||
--accent-bg-color: var(--accent-green);
|
||||
--accent-color: oklab(from var(--accent-bg-color) var(--standalone-color-oklab));
|
||||
}
|
||||
```
|
||||
|
||||
### New CSS Variables
|
||||
|
||||
```css
|
||||
/* Opacity variables */
|
||||
--dim-opacity
|
||||
--disabled-opacity
|
||||
--border-opacity
|
||||
|
||||
/* Window properties */
|
||||
--window-radius
|
||||
|
||||
/* All named colors now have CSS variable equivalents */
|
||||
--accent-bg-color
|
||||
--accent-color
|
||||
--destructive-bg-color
|
||||
--destructive-color
|
||||
/* etc. */
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Libadwaita 1.7+ Features
|
||||
|
||||
### AdwToggleGroup
|
||||
|
||||
Exclusive toggle buttons in a group.
|
||||
|
||||
```python
|
||||
group = Adw.ToggleGroup()
|
||||
|
||||
group.add(Adw.Toggle(label="Day"))
|
||||
group.add(Adw.Toggle(label="Week"))
|
||||
group.add(Adw.Toggle(label="Month"))
|
||||
|
||||
group.connect("notify::active", on_toggle_changed)
|
||||
```
|
||||
|
||||
### AdwWrapBox
|
||||
|
||||
Auto-wrapping box layout (like text flow).
|
||||
|
||||
```python
|
||||
wrap_box = Adw.WrapBox()
|
||||
wrap_box.set_spacing(6)
|
||||
wrap_box.set_line_spacing(6)
|
||||
|
||||
for tag in tags:
|
||||
wrap_box.append(create_tag_widget(tag))
|
||||
```
|
||||
|
||||
### AdwInlineViewSwitcher
|
||||
|
||||
View switcher for use inside cards/sidebars (not header bar).
|
||||
|
||||
```python
|
||||
switcher = Adw.InlineViewSwitcher()
|
||||
switcher.set_stack(view_stack)
|
||||
```
|
||||
|
||||
### AdwShortcutsDialog (Replaces GtkShortcutsWindow)
|
||||
|
||||
```python
|
||||
dialog = Adw.ShortcutsDialog()
|
||||
# Configure shortcuts groups and shortcuts
|
||||
dialog.present(parent)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Migration Guide
|
||||
|
||||
### Dialog Widgets
|
||||
|
||||
| Old Widget | New Widget | Notes |
|
||||
|------------|------------|-------|
|
||||
| `AdwMessageDialog` | `AdwAlertDialog` | Can scroll contents |
|
||||
| `AdwPreferencesWindow` | `AdwPreferencesDialog` | Search off by default |
|
||||
| `AdwAboutWindow` | `AdwAboutDialog` | Same API |
|
||||
| `GtkDialog` | `AdwDialog` | Esc-to-close automatic |
|
||||
|
||||
### Navigation Widgets
|
||||
|
||||
| Old Widget | New Widget | Notes |
|
||||
|------------|------------|-------|
|
||||
| `AdwLeaflet` (unfold=false) | `AdwNavigationView` | Gestures/shortcuts built-in |
|
||||
| `AdwLeaflet` | `AdwNavigationSplitView` | For sidebar patterns |
|
||||
| `AdwFlap` | `AdwOverlaySplitView` | Overlay sidebar |
|
||||
|
||||
### Key API Changes
|
||||
|
||||
**Dialog presenting:**
|
||||
```python
|
||||
# Old
|
||||
dialog.set_transient_for(window)
|
||||
dialog.show()
|
||||
|
||||
# New
|
||||
dialog.present(widget) # Any widget in window works
|
||||
```
|
||||
|
||||
**Close handling:**
|
||||
```python
|
||||
# Old (GtkWindow)
|
||||
def on_close_request(window):
|
||||
return True # Prevent close
|
||||
|
||||
# New (AdwDialog)
|
||||
dialog.set_can_close(False)
|
||||
dialog.connect("close-attempt", on_close_attempt)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Use New Dialogs
|
||||
- Prefer `AdwDialog` subclasses over `GtkWindow`-based dialogs
|
||||
- Better mobile support automatically
|
||||
- Consistent with platform
|
||||
|
||||
### Breakpoints Over Code
|
||||
- Define layouts declaratively in UI files
|
||||
- Use `sp` units for text-scale awareness
|
||||
- Set minimum window size (360×200 default in 1.6+)
|
||||
|
||||
### Accent Color Awareness
|
||||
- Don't assume blue accent
|
||||
- Use CSS variables, not hardcoded colors
|
||||
- Test with different system accents
|
||||
- Redraw custom widgets when accent changes
|
||||
|
||||
### Bottom Sheets for Persistent UI
|
||||
- Use `AdwBottomSheet` for player controls, toolbars
|
||||
- Works with `AdwHeaderBar` (hides title when drag handle shown)
|
||||
- Swipe-down works from header bar area
|
||||
|
||||
---
|
||||
|
||||
## External Resources
|
||||
|
||||
- [libadwaita 1.4 Blog Post](https://blogs.gnome.org/alicem/2023/09/15/libadwaita-1-4/)
|
||||
- [libadwaita 1.5 Blog Post](https://blogs.gnome.org/alicem/2024/03/15/libadwaita-1-5/)
|
||||
- [libadwaita 1.6 Blog Post](https://blogs.gnome.org/alicem/2024/09/13/libadwaita-1-6/)
|
||||
- [Migration to Adaptive Dialogs](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/migrating-to-adaptive-dialogs.html)
|
||||
- [CSS Variables Reference](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/css-variables.html)
|
||||
- [Style Classes Reference](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html)
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 2,
|
||||
"skills": {
|
||||
"designing-gnome-ui": {
|
||||
"source": "Paresh-Maheshwari/gnome-skills",
|
||||
"commit": "07182fbddec1ecfa296502f50f092f92ce454041",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/designing-gnome-ui/SKILL.md",
|
||||
"computedHash": "098b52e77110d85136fd75fb8daf0595a7b052e3be28f551785fd958ff3c3101"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user