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

Date text is rendered lower than other elements in status bar #27

Closed
AndrewBastin opened this issue May 20, 2017 · 8 comments
Closed

Date text is rendered lower than other elements in status bar #27

AndrewBastin opened this issue May 20, 2017 · 8 comments

Comments

@AndrewBastin
Copy link

Date text is rendered lower than other elements in the status bar as of Atom Version 1.17.0

atom

@b3by
Copy link
Owner

b3by commented May 20, 2017

Thank you for this. I'll look into it ASAP, as the rendering position has been an issue for quite a while. On which platform you experienced this problem?

@AndrewBastin
Copy link
Author

I am experiencing this in Windows...

@b3by
Copy link
Owner

b3by commented May 25, 2017

I'm fixing this right now. It seems to be a thing on OS X as well.

@ftm
Copy link
Contributor

ftm commented May 25, 2017

Removing all the CSS and adding the inline-block class to the clock element seemed to fix it for me. I'm on OS X by the way.

atom-clock.less:

@import "ui-variables";

.atom-clock {
  // display: inline-block;
  // margin-left: 1em;
  // margin-right: 0.5em;
  // position: relative;
  // vertical-align: middle;
  //
  // .span {
  //   text-align: left;
  // }
}

atom-clock-view.js:

drawElement() {
    this.element = document.createElement('div')
    this.element.className = 'atom-clock inline-block'
    this.element.appendChild(document.createElement('span'))

    this.statusBar.addRightTile({
      item: this.element,
      priority: -1
    })
  }

See before (top) and after (bottom)
screen shot 2017-05-25 at 11 33 00

@b3by
Copy link
Owner

b3by commented May 25, 2017

I actually did not change the code, just the style file, adding some stuff for the icon. The result seems to be pretty much the same.

@import "ui-variables";
@import "octicon-mixins";

.atom-clock {
  display: inline-block;
  position: relative;

  .icon:before {
    .icon-size(14px);
    top: 1px;
    margin-right: 3px;
  }

}

@b3by
Copy link
Owner

b3by commented May 25, 2017

Actually, the atom-clock class should also have margin-left set to @component-padding, so that there will be space between the clock and the element to the left.

@b3by
Copy link
Owner

b3by commented May 25, 2017

Seems to be reasonable. I still don't know whether this is the right solution, or the css style is useless.

screenshot 2017-05-26 00 05 48

@ftm
Copy link
Contributor

ftm commented May 25, 2017

The inline-block class seems to add margin-left: 1.5em so maybe the CSS could just be used to move the icon around. Up to you I guess, it seems to be what other packages are using

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

No branches or pull requests

3 participants