mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 17:43:08 -05:00
Fix 2
This commit is contained in:
parent
58ed353cca
commit
ce8c7efae7
2 changed files with 5 additions and 5 deletions
|
@ -1424,7 +1424,7 @@ static struct SettingsScreen {
|
|||
#if defined CC_BUILD_ANDROID
|
||||
static void SettingsScreen_LockOrientation(void* w, int idx) {
|
||||
struct LCheckbox* cb = (struct LCheckbox*)w;
|
||||
cb->value ^= true;
|
||||
cb->value = !cb->value;
|
||||
Options_SetBool(OPT_LANDSCAPE_MODE, cb->value);
|
||||
Window_LockLandscapeOrientation(cb->value);
|
||||
Launcher_Redraw();
|
||||
|
@ -1445,7 +1445,7 @@ static void SettingsScreen_Init(struct LScreen* s_) {
|
|||
LLabel_Init(s_, &s->lblColours, "&eChange how the launcher looks");
|
||||
|
||||
#if defined CC_BUILD_ANDROID
|
||||
LLabel_Init(s_, &s->lblOrientlock, "Portrait orientation lock");
|
||||
LLabel_Init(s_, &s->lblOrientlock, "Force landscape");
|
||||
LCheckbox_Init(s_, &s->cbOrientlock);
|
||||
s->cbOrientlock.OnClick = SettingsScreen_LockOrientation;
|
||||
#endif
|
||||
|
@ -1480,7 +1480,7 @@ static void SettingsScreen_Layout(struct LScreen* s_) {
|
|||
|
||||
#if defined CC_BUILD_ANDROID
|
||||
LWidget_SetLocation(&s->cbOrientlock, ANCHOR_CENTRE, ANCHOR_CENTRE, -178, 24);
|
||||
LWidget_SetLocation(&s->lblOrientlock, ANCHOR_CENTRE, ANCHOR_CENTRE, -58, 24);
|
||||
LWidget_SetLocation(&s->lblOrientlock, ANCHOR_CENTRE, ANCHOR_CENTRE, -84, 24);
|
||||
#endif
|
||||
|
||||
LWidget_SetLocation(&s->btnBack, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 170);
|
||||
|
|
|
@ -410,8 +410,8 @@ void Window_LockLandscapeOrientation(cc_bool lock) {
|
|||
JavaGetCurrentEnv(env);
|
||||
|
||||
/* SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 0x00000006 */
|
||||
/* SCREEN_ORIENTATION_USER = 0x00000002 */
|
||||
args[0].i = lock ? 0x00000006 : 0x00000002;
|
||||
/* SCREEN_ORIENTATION_UNSPECIFIED = 0xffffffff */
|
||||
args[0].i = lock ? 0x00000006 : 0xffffffff;
|
||||
JavaCallVoid(env, "setRequestedOrientation", "(I)V", args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue