-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: qt5ct dark mode integration using ansible (#4838)
Signed-off-by: KhalilSelyan <[email protected]> Co-authored-by: M. Fatih Cırıt <[email protected]>
- Loading branch information
1 parent
508036e
commit 549a7f8
Showing
55 changed files
with
2,182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
### Manual setup for running RViz2 | ||
|
||
Before running RViz2 manually, set the `QT_QPA_PLATFORMTHEME` environment variable to `qt5ct`. | ||
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. | ||
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. | ||
It also includes additional options such as respawn behavior and custom RViz2 configurations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# defaults file for qt5ct_setup |
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/downarrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/active/uparrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-end.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/branch-more.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/downarrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/leftarrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
...le/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
.../roles/qt5ct_setup/files/autoware-rviz-icons/disabled/radiobutton_unchecked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/rightarrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
ansible/roles/qt5ct_setup/files/autoware-rviz-icons/disabled/uparrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.