Skip to content

Commit eb2993c

Browse files
committed
Update app
1 parent ed046b4 commit eb2993c

35 files changed

+653
-178
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId 'com.winlator'
99
minSdkVersion 26
1010
targetSdkVersion 28
11-
versionCode 10
12-
versionName "4.0"
11+
versionCode 11
12+
versionName "5.0"
1313
}
1414

1515
buildTypes {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[
2-
{"name" : "BOX64_DYNAREC", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
32
{"name" : "BOX64_DYNAREC_SAFEFLAGS", "values" : ["0", "1", "2"], "defaultValue" : "2"},
43
{"name" : "BOX64_DYNAREC_FASTNAN", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
54
{"name" : "BOX64_DYNAREC_FASTROUND", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
65
{"name" : "BOX64_DYNAREC_X87DOUBLE", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "0"},
76
{"name" : "BOX64_DYNAREC_BIGBLOCK", "values" : ["0", "1", "2", "3"], "defaultValue" : "1"},
87
{"name" : "BOX64_DYNAREC_STRONGMEM", "values" : ["0", "1", "2", "3"], "defaultValue" : "0"},
98
{"name" : "BOX64_DYNAREC_FORWARD", "values" : ["0", "128", "256", "512", "1024"], "defaultValue" : "128"},
10-
{"name" : "BOX64_DYNAREC_CALLRET", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "0"},
9+
{"name" : "BOX64_DYNAREC_CALLRET", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
1110
{"name" : "BOX64_DYNAREC_WAIT", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"}
1211
]

app/src/main/assets/box86_env_vars.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[
2-
{"name" : "BOX86_DYNAREC", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
32
{"name" : "BOX86_DYNAREC_SAFEFLAGS", "values" : ["0", "1", "2"], "defaultValue" : "2"},
43
{"name" : "BOX86_DYNAREC_FASTNAN", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
54
{"name" : "BOX86_DYNAREC_FASTROUND", "values" : ["0", "1"], "toggleSwitch" : true, "defaultValue" : "1"},
295 Bytes
Loading
354 Bytes
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"id":3,"name":"Virtual Gamepad","cursorSpeed":1,"elements":[{"type":"D_PAD","shape":"CIRCLE","bindings":["GAMEPAD_DPAD_UP","GAMEPAD_DPAD_RIGHT","GAMEPAD_DPAD_DOWN","GAMEPAD_DPAD_LEFT"],"scale":0.85,"x":0.21568627655506134,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_X","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_Y","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_A","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_B","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_R2","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.2888889014720917,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_R1","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.42222222685813904,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_L1","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.42222222685813904,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_L2","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.2888889014720917,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["GAMEPAD_BUTTON_START","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["GAMEPAD_BUTTON_SELECT","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"STICK","shape":"CIRCLE","bindings":["GAMEPAD_LEFT_THUMB_UP","GAMEPAD_LEFT_THUMB_RIGHT","GAMEPAD_LEFT_THUMB_DOWN","GAMEPAD_LEFT_THUMB_LEFT"],"scale":1,"x":0.10784313827753067,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"STICK","shape":"CIRCLE","bindings":["GAMEPAD_RIGHT_THUMB_UP","GAMEPAD_RIGHT_THUMB_RIGHT","GAMEPAD_RIGHT_THUMB_DOWN","GAMEPAD_RIGHT_THUMB_LEFT"],"scale":1,"x":0.7843137383460999,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_L3","NONE","NONE","NONE"],"scale":0.85,"x":0.21568627655506134,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_R3","NONE","NONE","NONE"],"scale":0.85,"x":0.7843137383460999,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0}]}
1+
{"id":3,"name":"Virtual Gamepad","cursorSpeed":1,"elements":[{"type":"D_PAD","shape":"CIRCLE","bindings":["GAMEPAD_DPAD_UP","GAMEPAD_DPAD_RIGHT","GAMEPAD_DPAD_DOWN","GAMEPAD_DPAD_LEFT"],"scale":0.85,"x":0.21568627655506134,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_X","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_Y","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_A","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_B","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_R2","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.2888889014720917,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_R1","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.42222222685813904,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_L1","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.42222222685813904,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["GAMEPAD_BUTTON_L2","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.2888889014720917,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["GAMEPAD_BUTTON_START","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":15},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["GAMEPAD_BUTTON_SELECT","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":16},{"type":"STICK","shape":"CIRCLE","bindings":["GAMEPAD_LEFT_THUMB_UP","GAMEPAD_LEFT_THUMB_RIGHT","GAMEPAD_LEFT_THUMB_DOWN","GAMEPAD_LEFT_THUMB_LEFT"],"scale":1,"x":0.10784313827753067,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"STICK","shape":"CIRCLE","bindings":["GAMEPAD_RIGHT_THUMB_UP","GAMEPAD_RIGHT_THUMB_RIGHT","GAMEPAD_RIGHT_THUMB_DOWN","GAMEPAD_RIGHT_THUMB_LEFT"],"scale":1,"x":0.7843137383460999,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_L3","NONE","NONE","NONE"],"scale":0.85,"x":0.21568627655506134,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["GAMEPAD_BUTTON_R3","NONE","NONE","NONE"],"scale":0.85,"x":0.7843137383460999,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0}]}

app/src/main/assets/patches.tzst

1.02 MB
Binary file not shown.

app/src/main/assets/wine_startmenu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"name" : "Wordpad",
15-
"path" : "C:/windows/system32/wordpad.exe"
15+
"path" : "C:/windows/system32/write.exe"
1616
},
1717
{
1818
"name" : "Games",

app/src/main/java/com/winlator/ContainerDetailFragment.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.Intent;
66
import android.content.SharedPreferences;
7+
import android.graphics.Color;
78
import android.net.Uri;
89
import android.os.Bundle;
910
import android.os.Environment;
@@ -38,8 +39,10 @@
3839
import com.winlator.core.StringUtils;
3940
import com.winlator.core.WineInfo;
4041
import com.winlator.core.WineRegistryEditor;
42+
import com.winlator.core.WineThemeManager;
4143
import com.winlator.core.WineUtils;
4244
import com.winlator.widget.CPUListView;
45+
import com.winlator.widget.ColorPickerView;
4346

4447
import org.json.JSONArray;
4548
import org.json.JSONException;
@@ -148,13 +151,13 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup r
148151
final CPUListView cpuListView = view.findViewById(R.id.CPUListView);
149152
if (editContainer) cpuListView.setCheckedCPUList(container.getCPUList());
150153

151-
createWineRegistryKeysTab(view);
154+
createWineConfigurationTab(view);
152155
createDXComponentsTab(view);
153156
createEnvVarsTab(view);
154157
createDrivesTab(view);
155158

156159
view.findViewById(R.id.BTAddEnvVar).setOnClickListener((v) -> (new AddEnvVarDialog(context, view)).show());
157-
AppUtils.setupTabLayout(view, R.id.TabLayout, R.id.LLTabWineRegistryKeys, R.id.LLTabDXComponents, R.id.LLTabEnvVars, R.id.LLTabDrives, R.id.LLTabAdvanced);
160+
AppUtils.setupTabLayout(view, R.id.TabLayout, R.id.LLTabWineConfiguration, R.id.LLTabDXComponents, R.id.LLTabEnvVars, R.id.LLTabDrives, R.id.LLTabAdvanced);
158161

159162
view.findViewById(R.id.BTConfirm).setOnClickListener((v) -> {
160163
try {
@@ -171,6 +174,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup r
171174
boolean stopServicesOnStartup = cbStopServicesOnStartup.isChecked();
172175
String box86Preset = Box86_64PresetManager.getSpinnerSelectedId(sBox86Preset);
173176
String box64Preset = Box86_64PresetManager.getSpinnerSelectedId(sBox64Preset);
177+
String desktopTheme = getDesktopTheme(view);
174178

175179
if (editContainer) {
176180
container.setName(name);
@@ -186,6 +190,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup r
186190
container.setStopServicesOnStartup(stopServicesOnStartup);
187191
container.setBox86Preset(box86Preset);
188192
container.setBox64Preset(box64Preset);
193+
container.setDesktopTheme(desktopTheme);
189194
container.saveData();
190195
saveWineRegistryKeys(view);
191196
getActivity().onBackPressed();
@@ -205,6 +210,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup r
205210
data.put("stopServicesOnStartup", stopServicesOnStartup);
206211
data.put("box86Preset", box86Preset);
207212
data.put("box64Preset", box64Preset);
213+
data.put("desktopTheme", desktopTheme);
208214

209215
if (wineInfos.size() > 1) {
210216
data.put("wineVersion", wineInfos.get(sWineVersion.getSelectedItemPosition()).identifier());
@@ -278,8 +284,15 @@ private void saveWineRegistryKeys(View view) {
278284
}
279285
}
280286

281-
private void createWineRegistryKeysTab(View view) {
287+
private void createWineConfigurationTab(View view) {
282288
Context context = getContext();
289+
290+
String[] desktopTheme = (container != null ? container.getDesktopTheme() : WineThemeManager.DEFAULT_THEME+","+WineThemeManager.DEFAULT_BACKGROUND).split(",");
291+
Spinner sDesktopTheme = view.findViewById(R.id.SDesktopTheme);
292+
sDesktopTheme.setSelection(WineThemeManager.Theme.valueOf(desktopTheme[0]).ordinal());
293+
ColorPickerView cpvDesktopBackground = view.findViewById(R.id.CPVDesktopBackground);
294+
cpvDesktopBackground.setColor(Color.parseColor(desktopTheme[1]));
295+
283296
File containerDir = container != null ? container.getRootDir() : null;
284297
File userRegFile = new File(containerDir, ".wine/user.reg");
285298

@@ -371,6 +384,13 @@ private String getScreenSize(View view) {
371384
return StringUtils.parseIdentifier(value);
372385
}
373386

387+
private String getDesktopTheme(View view) {
388+
Spinner sDesktopTheme = view.findViewById(R.id.SDesktopTheme);
389+
ColorPickerView cpvDesktopBackground = view.findViewById(R.id.CPVDesktopBackground);
390+
WineThemeManager.Theme theme = WineThemeManager.Theme.values()[sDesktopTheme.getSelectedItemPosition()];
391+
return theme+","+cpvDesktopBackground.getColorAsString();
392+
}
393+
374394
private void loadScreenSizeSpinner(View view, String selectedValue) {
375395
final Spinner sScreenSize = view.findViewById(R.id.SScreenSize);
376396

app/src/main/java/com/winlator/XServerDisplayActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.winlator.core.WineInfo;
3737
import com.winlator.core.WineRegistryEditor;
3838
import com.winlator.core.WineStartMenuCreator;
39+
import com.winlator.core.WineThemeManager;
3940
import com.winlator.core.WineUtils;
4041
import com.winlator.inputcontrols.ControlsProfile;
4142
import com.winlator.inputcontrols.ExternalController;
@@ -286,6 +287,13 @@ private void setupWineSystemFiles() {
286287
containerDataChanged = true;
287288
}
288289

290+
String desktopTheme = container.getDesktopTheme();
291+
if (!desktopTheme.equals(container.getExtra("desktopTheme"))) {
292+
String[] desktopThemeArray = desktopTheme.split(",");
293+
WineThemeManager.apply(this, WineThemeManager.Theme.valueOf(desktopThemeArray[0]), desktopThemeArray[1]);
294+
container.putExtra("desktopTheme", desktopTheme);
295+
}
296+
289297
if (containerDataChanged) container.saveData();
290298
WineStartMenuCreator.create(this, container);
291299

0 commit comments

Comments
 (0)