Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows 10 style window titlebar #508

Closed
wants to merge 3 commits into from
Closed

Add Windows 10 style window titlebar #508

wants to merge 3 commits into from

Conversation

spikespaz
Copy link
Contributor

I have added the basic SVGs for this, added to the settings menu, and created the theme setting. I'm not sure if I did it properly, it took a lot of guesswork since I've never used Node or React before. It works, with a few caveats.

  • The icon in the settings menu looks terrible. I couldn't figure out how to make it, because I don't understand very well how SVG viewboxes work in conjunction with width and height.

  • The titlebar buttons are on the left. I got them on the right in the correct position using text-align: right; right: 1px; in the browser developer tools on the .window-controls class, but could not figure out hoe to make the changes in the code itself. My attempt in the file components/Carbon.js can be seen below, added somewhere around line 219.

.container :global(.window-theme__sharp > .CodeMirror),
.container :global(.window-theme__win > .CodeMirror) {
  border-radius: 0px;
}

.container :global(.window-theme__bw > .CodeMirror) {
  border: 2px solid ${COLORS.SECONDARY};
}

.container :global(.window-theme__win + .window-controls) {
  text-align: right;
  right: 1px; /* Necessary to match Windows titlebar exactly. */
}

image

With the above CSS, the style is pixel-perfect to match Windows. Unfortunately the positioning is not.

This pull request needs work, but I'm not sure how to do it myself. I hope this addition is sufficient for the maintainers to work off of.

@vercel
Copy link

vercel bot commented Sep 23, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@mfix22
Copy link
Contributor

mfix22 commented Feb 1, 2019

Closing this as wontfix. It is not that we don't want to support Windows users, it is just that the style doesn't fit in with the rest of Carbon.

@mfix22 mfix22 closed this Feb 1, 2019
@spikespaz
Copy link
Contributor Author

@mfix22 So basically you don't want to support Windows users.

@nogweii
Copy link

nogweii commented Feb 1, 2019

I am confused about this decision as well, where does it not fit in?

@mfix22
Copy link
Contributor

mfix22 commented Feb 1, 2019

Sorry. To reiterate, we want to support it, I just want the design of the feature to fit it more with the design of the current components, meaning it fits the current aesthetic. For that reason, our team will be building out the SVGs for it 👍

Secondly, this branch has not been mergeable for months, so I thought you no longer wanted to champion this feature. It is apparent that is not true.

Going forward, please keep the discussion positive — there is plenty of room to argue your case for keeping the feature without strawman-ing our team.

@mfix22 mfix22 reopened this Feb 1, 2019
@spikespaz
Copy link
Contributor Author

@mfix22 I understand your point. You are correct, if you feel that the team could make better SVGs that "feel like Windows" and integrate with the existing style of Carbon, go for it.

To address your second point; yes, I agree, this PR is incomplete and should not be merged yet. That is why I asked for help.

The titlebar buttons are on the left. I got them on the right in the correct position using text-align: right; right: 1px; in the browser developer tools on the .window-controls class, but could not figure out how to make the changes in the code itself.

Basically I was requesting assistance with this, because I wasn't sure where to put the CSS that positions the titlebar buttons on the right of the window.

For your third statement, what negativity did you see? Neither me nor @evaryont understood the reasoning behind closing this PR with no further comment. Your statement seemed to be an oxymoron, contradicting itself without further reasoning. My apologies if any offense was taken. Perhaps my reply was rash.

@mfix22
Copy link
Contributor

mfix22 commented Feb 3, 2019

Understood, I appreciate you explaining yourself. I never meant for closing the PR to be a permanent resolution — we could always open a new PR or reopen this one.

I will look into supporting this feature while staying true to the Carbon aesthetic.

Copy link

@gioragutt gioragutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the controls picking a bit cleaner and open to additions of more controls.

@@ -36,7 +36,7 @@ function renderCopyButton({ copied }) {

export default ({ titleBar, theme, handleTitleBarChange, copyable, code }) => (
<div className="window-controls">
{theme === 'bw' ? <ControlsBW /> : <Controls />}
{theme === 'bw' ? <ControlsBW /> : theme === 'win' ? <ControlsWin /> : <Controls />}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with f.e an object:

const controls = {
  bw: <ControlsBW />,
  win: <ControlsWin />
}

{ controls[theme] || <Controls /> }

@mfix22 mfix22 force-pushed the master branch 2 times, most recently from 81583c0 to d8af796 Compare June 24, 2019 22:28
@binyamin
Copy link
Contributor

binyamin commented Nov 5, 2019

@mfix22 just wondering what the status on this is? The age of this PR gave me the impression that this is not an active repo.

@mfix22
Copy link
Contributor

mfix22 commented Nov 6, 2019

@b3u this repo is still very much active, we have just had more important priorities to improving the application and code. We still want to support this, but in a way that stays true to the original style/brand/theme of Carbon.

My apologies for the delay. Are you waiting on the Windows theme yourself? Or were you more just concerned about how active the repo is? 🙂

@binyamin
Copy link
Contributor

binyamin commented Nov 6, 2019

I had a PR I was going to make, and subsequently made; I was unsure about whether it would get merged. That's all.

@mfix22 mfix22 linked an issue May 14, 2020 that may be closed by this pull request
@mfix22
Copy link
Contributor

mfix22 commented May 15, 2020

@b3u I am going to take a look at this feature tomorrow. If you have a version you want me to consider, please push up a PR 🙂

@mfix22 mfix22 mentioned this pull request May 15, 2020
@mfix22 mfix22 closed this in #1008 May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft Windows 10 style?
6 participants