drcika / apc-extension

https://marketplace.visualstudio.com/items?itemName=drcika.apc-extension
MIT License
599 stars 24 forks source link

Enter zen mode and exit break traffic light #119

Open xzbdmw opened 8 months ago

xzbdmw commented 8 months ago

vscode version:1.85 my config:

 "apc.electron": {
        "titleBarStyle": "hiddenInset",
        "trafficLightPosition": {
            "x": 14,
            "y": 12
        },
    },
 "apc.activityBar": {
        "position": "bottom",
        "size": 30, 
    },

https://github.com/drcika/apc-extension/assets/97848247/7fc47450-f8f7-4b9d-ad16-b1f250138cee

xzbdmw commented 8 months ago

If this is reproduceable, I can make a PR to fix that

impuLssse commented 8 months ago

make it, pleaze!

xzbdmw commented 8 months ago

make it, pleaze!

I'm not centain about the plugin's css rules, but this mannually insert css class code works for me on macOS. In modules/override.js, find exports.toggleZenMode, and inject these code

  exports.toggleZenMode = function (original) {
      // fire on init if zenMode == true
      if (!store.initialised) { return original(); }
      store.zenMode = !store.zenMode;
      if (store.zenMode) {
        // config.activityBar.isHorizontal && activitybar.restore();
        config.statusBar.position !== 'bottom' && statusbar.restore();
      }
      original();
      if (!store.zenMode) {
        // config.activityBar.isHorizontal && activitybar.move();
        config.statusBar.position !== 'bottom' && statusbar.update();
        if (store.isMacintosh) {
          config.inlineTabsPlaceholder = UI.createDiv('inline-tabs-placeholder');
          addTabsPlaceHolder();
        }
      }
    };
 exports.setPartHidden = function (original, [hidden, part]) {
      if (part !== store.Parts.SIDEBAR_PART) { return original(); }
      const { isHorizontal } = config.activityBar;
      // isHorizontal && hidden && activitybar.restore({ hidden });
      const res = original();
      // isHorizontal && !hidden && activitybar.move();
      return res;
    };

notice the four commented line, other wise the plugin may broken so I'm not going to make a pr

videopilot commented 8 months ago

Yeah, I'm getting the same here. Seems the .inline-tabs-placeholder is being removed and not coming back after exiting zen (if tabs are hidden in zen mode for me). Opening and closing a new tab restores it.

Screen Recording 2023-12-28 at 2 29 22 PM

videopilot commented 8 months ago

I currently have this in my APC css to solve it. Seems to work but not sure if it covers all cases.

".inline-tabs-placeholder": "display:none !important",
"body > div.mac:not(.fullscreen) .split-view-view:first-child > .editor-group-top .title .monaco-scrollable-element": "margin-left:78px;",
"body > div.mac:not(.fullscreen) .split-view-view:first-child > .editor-group-top .title .monaco-scrollable-element .tab:first-child": "border-left: 1px solid var(--vscode-tab-border)",

It does prevent dragging the window with the title bar area right around the traffic lights.