mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-25 18:33:11 +00:00
isMobileDevice shrinks gutters
This commit is contained in:
parent
e81f6989ce
commit
3041b08ae0
@ -2074,7 +2074,7 @@ function revealTopBar() {
|
||||
export function setupSplits() {
|
||||
const splitName = 'workspace-split3-' + platform_id;
|
||||
var sizes = [0, 50, 50];
|
||||
if (!platform_id.startsWith('vcs') && !qs['embed'])
|
||||
if (!(platform_id.startsWith('vcs') || qs['embed'] || Views.isMobileDevice))
|
||||
sizes = [12, 44, 44];
|
||||
var sizesStr = hasLocalStorage && localStorage.getItem(splitName);
|
||||
if (sizesStr) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
//import CodeMirror = require("codemirror");
|
||||
import { SourceFile, WorkerError, Segment, FileData, SourceLocation, SourceLine } from "../common/workertypes";
|
||||
import { Platform, EmuState, lookupSymbol, BaseDebugPlatform, BaseZ80MachinePlatform, BaseZ80Platform, CpuState } from "../common/baseplatform";
|
||||
import { BaseZ80MachinePlatform, BaseZ80Platform } from "../common/baseplatform";
|
||||
import { hex, lpad, rpad, safeident, rgb2bgr } from "../common/util";
|
||||
import { CodeAnalyzer } from "../common/analysis";
|
||||
import { platform, platform_id, compparams, current_project, lastDebugState, projectWindows, runToPC } from "./ui";
|
||||
import { ProbeRecorder, ProbeFlags } from "../common/recorder";
|
||||
import { getMousePos, dumpRAM, Toolbar } from "../common/emu";
|
||||
import { getMousePos, dumpRAM } from "../common/emu";
|
||||
import * as pixed from "./pixeleditor";
|
||||
declare var Mousetrap;
|
||||
|
||||
@ -29,6 +29,9 @@ export interface ProjectView {
|
||||
undoStep?() : void;
|
||||
};
|
||||
|
||||
// detect mobile (https://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-mobile-device)
|
||||
export var isMobileDevice = window.matchMedia("only screen and (max-width: 760px)").matches;
|
||||
|
||||
declare var CodeMirror;
|
||||
declare var VirtualList;
|
||||
|
||||
@ -115,10 +118,10 @@ export class SourceEditor implements ProjectView {
|
||||
var isAsm = isAsmOverride || modedef.isAsm;
|
||||
var lineWrap = !!modedef.lineWrap;
|
||||
var theme = modedef.theme || MODEDEFS.default.theme;
|
||||
var lineNums = !modedef.noLineNumbers;
|
||||
var lineNums = !modedef.noLineNumbers && !isMobileDevice;
|
||||
var gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-info"];
|
||||
if (isAsm) gutters = ["CodeMirror-linenumbers", "gutter-offset", "gutter-bytes", "gutter-clock", "gutter-info"];
|
||||
if (modedef.noGutters) gutters = ["gutter-info"];
|
||||
if (modedef.noGutters || isMobileDevice) gutters = ["gutter-info"];
|
||||
this.editor = CodeMirror(parent, {
|
||||
theme: theme,
|
||||
lineNumbers: lineNums,
|
||||
|
Loading…
Reference in New Issue
Block a user