Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: qt5ct dark mode integration using ansible #4838

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
61b8640
feat: automate configuration of qt5ct environment for Autoware
KhalilSelyan Jun 7, 2024
681849c
feat: add necessary qss, icons, base-config
KhalilSelyan Jun 7, 2024
7a1e5c6
feat: add role for setting up qt5ct configuration
KhalilSelyan Jun 7, 2024
b2586aa
style(pre-commit): autofix
pre-commit-ci[bot] Jun 7, 2024
9f7fc56
fix title capitalization
Sep 3, 2024
7c33bd0
fix become true
Sep 3, 2024
93100ff
small fix for toolbutton checked status
KhalilSelyan Sep 5, 2024
ca17eaf
update installation process
Sep 6, 2024
4b48822
style(pre-commit): autofix
pre-commit-ci[bot] Sep 6, 2024
416e5e3
format qss file in vscode as css
Sep 9, 2024
cacc07b
fix the vertical handle
Sep 9, 2024
f357135
make qtoolbuttons smaller and capsule
Sep 9, 2024
2393560
fix scrollbars and splitters
Sep 9, 2024
553df4e
qmenu and some checkboxes
Sep 9, 2024
48f581c
qtoolbutton colors
Sep 9, 2024
518448f
Add new SVG icons for minus, add, splitter-hor, splitter-vert, and close
KhalilSelyan Sep 11, 2024
4757d17
Refactor UI components for improved visual consistency and usability
KhalilSelyan Sep 11, 2024
ee305f9
style(pre-commit): autofix
pre-commit-ci[bot] Sep 11, 2024
7cd7ff5
fix: precommit ci fixes
KhalilSelyan Sep 11, 2024
f499456
Refactor qt5ct_setup tasks for improved file permissions and consiste…
KhalilSelyan Sep 11, 2024
3be30a4
use canonical module name ansible.posix.synchronize instead of ansibl…
KhalilSelyan Sep 11, 2024
0ad6277
role 'qt5ct_setup' was not found fix
KhalilSelyan Sep 11, 2024
8ec0bfc
Style updates according to review comments
KhalilSelyan Sep 11, 2024
a137caf
improve styles to be more consistent with figma theme
KhalilSelyan Sep 11, 2024
2d1af92
style(pre-commit): autofix
pre-commit-ci[bot] Sep 12, 2024
4930cfb
update task name
Sep 16, 2024
caa3fd2
remove qt5ct from auto-start
Sep 16, 2024
aa6e38c
fix splitter handles
Sep 16, 2024
3fd7a43
make buttons smaller
Sep 17, 2024
902304d
remove unused icons
Sep 17, 2024
db24b43
update comment
Sep 17, 2024
307b63b
update the readme
Sep 17, 2024
d7228ea
style(pre-commit): autofix
pre-commit-ci[bot] Sep 17, 2024
1dbccd0
precommit
Sep 18, 2024
edc203d
update svgs to remove metadata (smaller size)
KhalilSelyan Sep 18, 2024
84b1829
simplify the readme
Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ansible/playbooks/install_rviz_theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Install RViz theme
hosts: localhost
roles:
- autoware.dev_env.qt5ct_setup
3 changes: 3 additions & 0 deletions ansible/playbooks/universe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@
# ONNX files and other artifacts
- role: autoware.dev_env.artifacts
when: prompt_download_artifacts == 'y'

# Qt5ct setup (RViz theme)
- role: autoware.dev_env.qt5ct_setup
60 changes: 60 additions & 0 deletions ansible/roles/qt5ct_setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# qt5ct_setup Ansible role

## Overview

The `qt5ct_setup` Ansible role automates the configuration of the `qt5ct` environment for Autoware.
It won't affect the system-wide configuration.

## Installation

Follow the instructions below to **install** or **update** the custom theme for `RViz2` in Autoware.

> **Important:** Both commands must be run when you want to update the theme.

```bash
cd ~/autoware # The root directory of the cloned repository
ansible-galaxy collection install -f -r "ansible-galaxy-requirements.yaml"
ansible-playbook autoware.dev_env.install_rviz_theme --ask-become-pass
```

## How to use the custom theme in RViz2

To apply a custom theme to RViz2, you can use the `qt5ct` platform theme. Follow these steps to ensure that the `QT_QPA_PLATFORMTHEME` environment variable is set correctly for your RViz2 instance when used with Autoware.

Check warning on line 22 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)

### Manual setup for running RViz2

Before running RViz2 manually, set the `QT_QPA_PLATFORMTHEME` environment variable to `qt5ct`.

Check warning on line 26 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
This ensures that the custom theme settings are applied.

```bash
export QT_QPA_PLATFORMTHEME=qt5ct
```

Then, start RViz2 as usual.

```bash
rviz2
```

### Automatic setup in Autoware

In Autoware, the `QT_QPA_PLATFORMTHEME` environment variable is automatically set within the main [autoware.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/autoware.launch.xml) file.

Check warning on line 41 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
Therefore, you do not need to manually set this environment variable when launching Autoware.

In the `autoware.launch.xml` file, RViz2 is configured with the following `<node>` element:

```xml
<node
pkg="rviz2"
exec="rviz2"
name="rviz2"
output="screen"
args="-d $(var rviz_config) -s $(find-pkg-share autoware_launch)/rviz/image/autoware.png"
if="$(var rviz)"
respawn="$(var rviz_respawn)">
<env name="QT_QPA_PLATFORMTHEME" value="qt5ct"/>
</node>
```

This configuration automatically sets the `QT_QPA_PLATFORMTHEME` to `qt5ct` when RViz2 is launched as part of Autoware.

Check warning on line 59 in ansible/roles/qt5ct_setup/README.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (PLATFORMTHEME)
It also includes additional options such as respawn behavior and custom RViz2 configurations.
1 change: 1 addition & 0 deletions ansible/roles/qt5ct_setup/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# defaults file for qt5ct_setup
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading