Skip to content

Commit 5ce118e

Browse files
authored
♻️ Refactoring DeviceSelectorAction (#8475)
Continue working on #8471. The PR refactored the device selector. **Changes** 1. Now it builds the component without a combo box button and has an adaptive interface provided by the IntelliJ platform. 2. Device icons are updated to use icons from [Material Symbols (Rounded)](https://fonts.google.com/icons?icon.size=16&icon.platform=web&icon.set=Material+Symbols&icon.style=Rounded). This is supported by Claude Sonnet 4 (75%), GPT-5 (20%), and Gemini 2.5 Pro (5%). **Screenshots** | Variants | Before | After | |:---:|:---:|:---:| | Regular | <img width="412" height="286" alt="image" src="https://github.com/user-attachments/assets/745632f7-6f96-4810-a07c-7885c35889ba" /> | <img width="416" height="288" alt="image" src="https://github.com/user-attachments/assets/b74b5d68-381a-4097-aef4-f2086e232de1" /> | | Compact | <img width="396" height="264" alt="image" src="https://github.com/user-attachments/assets/15075978-1bbb-4191-9382-071fe9b11d60" /> | <img width="402" height="264" alt="image" src="https://github.com/user-attachments/assets/a8d73e37-9af4-4e25-afa5-6117d7f98f57" /> |
1 parent 63d5995 commit 5ce118e

17 files changed

+285
-78
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Resolved a "Slow operations are prohibited on EDT" exception on Flutter Project creation (#8446, #8447, #8448)
1212
- Made dev release daily instead of weekly
1313
- Set the device selector component to opaque during its creation to avoid an unexpected background color (#8471)
14+
- Refactored `DeviceSelectorAction` and add rich icons to different platform devices (#8475)
1415

1516
## 87.1.0
1617

resources/META-INF/plugin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<!--suppress PluginXmlCapitalization -->
5858
<action id="Flutter.DeviceSelector" class="io.flutter.actions.DeviceSelectorAction"
5959
description="Flutter Device Selection"
60-
icon="FlutterIcons.Phone"/>
60+
icon="FlutterIcons.Mobile"/>
6161
<action id="Flutter.DeviceSelectorRefresher" class="io.flutter.actions.DeviceSelectorRefresherAction"
6262
text="Refresh Device List"
6363
description="Refresh device list"
@@ -70,7 +70,7 @@
7070
<!--suppress PluginXmlCapitalization -->
7171
<action id="Flutter.DeviceSelectorLegacy" class="io.flutter.actions.DeviceSelectorAction"
7272
description="Flutter Device Selection"
73-
icon="FlutterIcons.Phone"/>
73+
icon="FlutterIcons.Mobile"/>
7474
<action id="Flutter.DeviceSelectorRefresherLegacy" class="io.flutter.actions.DeviceSelectorRefresherAction"
7575
text="Refresh Device List"
7676
description="Refresh device list" />

resources/icons/android.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/icons/desktop.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/icons/ios.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/icons/mobile.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/icons/phone.png

-320 Bytes
Binary file not shown.

resources/icons/[email protected]

-416 Bytes
Binary file not shown.

resources/icons/web.svg

Lines changed: 1 addition & 0 deletions
Loading

src/icons/FlutterIcons.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ private static Icon load(String path) {
1717
public static final Icon Flutter = load("/icons/flutter.png");
1818
public static final Icon Flutter_2x = load("/icons/[email protected]");
1919
public static final Icon Flutter_test = load("/icons/flutter_test.png");
20-
public static final Icon Phone = load("/icons/phone.png");
2120
public static final Icon RefreshItems = load("/icons/refresh_items.png");
2221

22+
public static final Icon Android = load("/icons/android.svg");
23+
public static final Icon IOS = load("/icons/ios.svg");
24+
public static final Icon Mobile = load("/icons/mobile.svg");
25+
public static final Icon Desktop = load("/icons/desktop.svg");
26+
public static final Icon Web = load("/icons/web.svg");
27+
2328
public static final Icon Dart_16 = load("/icons/dart_16.svg");
2429

2530
public static final Icon HotReload = load("/icons/hot-reload.png");

0 commit comments

Comments
 (0)