Skip to content

Commit

Permalink
Merge upstream tag v1.12.0
Browse files Browse the repository at this point in the history
- commit '4d9379fea95c7ee213d17964cfc4bd091d88b66f'

# Conflicts:
#	lib/main.coffee
#	package.json
#	spec/theme-spec.coffee
  • Loading branch information
Csaba Maulis committed Apr 12, 2018
2 parents 9bdaf92 + 4d9379f commit 0cdd697
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 55 deletions.
57 changes: 44 additions & 13 deletions lib/main.coffee
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
root = document.documentElement
themeName = 'solarized-one-light-ui'


module.exports =
activate: (state) ->
atom.config.observe 'solarized-one-light-ui.fontSize', (value) ->
atom.config.observe "#{themeName}.fontSize", (value) ->
setFontSize(value)

atom.config.observe 'solarized-one-light-ui.tabSizing', (value) ->
atom.config.observe "#{themeName}.tabSizing", (value) ->
setTabSizing(value)

atom.config.observe 'solarized-one-light-ui.hideDockButtons', (value) ->
atom.config.observe "#{themeName}.tabCloseButton", (value) ->
setTabCloseButton(value)

atom.config.observe "#{themeName}.hideDockButtons", (value) ->
setHideDockButtons(value)

atom.config.observe "#{themeName}.stickyHeaders", (value) ->
setStickyHeaders(value)

# DEPRECATED: This can be removed at some point (added in Atom 1.17/1.18ish)
# It removes `layoutMode`
if atom.config.get('solarized-one-light-ui.layoutMode')
atom.config.unset('solarized-one-light-ui.layoutMode')
if atom.config.get("#{themeName}.layoutMode")
atom.config.unset("#{themeName}.layoutMode")

deactivate: ->
unsetFontSize()
unsetTabSizing()
unsetTabCloseButton()
unsetHideDockButtons()
unsetStickyHeaders()


# Font Size -----------------------

setFontSize = (currentFontSize) ->
if Number.isInteger(currentFontSize)
root.style.fontSize = "#{currentFontSize}px"
else if currentFontSize is 'Auto'
unsetFontSize()
root.style.fontSize = "#{currentFontSize}px"

unsetFontSize = ->
root.style.fontSize = ''
Expand All @@ -37,19 +44,43 @@ unsetFontSize = ->
# Tab Sizing -----------------------

setTabSizing = (tabSizing) ->
root.setAttribute('theme-solarized-one-light-ui-tabsizing', tabSizing.toLowerCase())
root.setAttribute("theme-#{themeName}-tabsizing", tabSizing.toLowerCase())

unsetTabSizing = ->
root.removeAttribute('theme-solarized-one-light-ui-tabsizing')
root.removeAttribute("theme-#{themeName}-tabsizing")


# Tab Close Button -----------------------

setTabCloseButton = (tabCloseButton) ->
if tabCloseButton is 'Left'
root.setAttribute("theme-#{themeName}-tab-close-button", 'left')
else
unsetTabCloseButton()

unsetTabCloseButton = ->
root.removeAttribute("theme-#{themeName}-tab-close-button")


# Dock Buttons -----------------------

setHideDockButtons = (hideDockButtons) ->
if hideDockButtons
root.setAttribute('theme-solarized-one-light-ui-dock-buttons', 'hidden')
root.setAttribute("theme-#{themeName}-dock-buttons", 'hidden')
else
unsetHideDockButtons()

unsetHideDockButtons = ->
root.removeAttribute('theme-solarized-one-light-ui-dock-buttons')
root.removeAttribute("theme-#{themeName}-dock-buttons")


# Sticky Headers -----------------------

setStickyHeaders = (stickyHeaders) ->
if stickyHeaders
root.setAttribute("theme-#{themeName}-sticky-headers", 'sticky')
else
unsetStickyHeaders()

unsetStickyHeaders = ->
root.removeAttribute("theme-#{themeName}-sticky-headers")
43 changes: 34 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solarized-one-light-ui",
"theme": "ui",
"version": "1.10.10",
"version": "1.12.0",
"description": "Solarized One light UI Theme for Atom. A perfect companion for the Solarized Dark Syntax Theme.",
"keywords": [
"light",
Expand All @@ -20,14 +20,22 @@
"configSchema": {
"fontSize": {
"title": "Font Size",
"description": "Change the UI font size. Needs to be between 8 and 20. In Auto mode, the Font Size will automatically change based on the window size.",
"type": [
"integer",
"string"
"description": "Change the font size for the UI.",
"type": "integer",
"default": 12,
"enum": [
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
],
"minimum": 8,
"maximum": 20,
"default": "Auto",
"order": 1
},
"tabSizing": {
Expand All @@ -42,12 +50,29 @@
],
"order": 2
},
"tabCloseButton": {
"title": "Tab Close Button",
"description": "Choose the position of the close button shown in tabs.",
"type": "string",
"default": "Right",
"enum": [
"Left",
"Right"
],
"order": 3
},
"hideDockButtons": {
"title": "Hide dock toggle buttons",
"description": "Note: When hiding the toggle buttons, opening a dock needs to be done by using the keyboard or other alternatives.",
"type": "boolean",
"default": "false",
"order": 3
"order": 4
},
"stickyHeaders": {
"title": "Make tree-view project headers sticky",
"type": "boolean",
"default": "true",
"order": 5
}
}
}
37 changes: 24 additions & 13 deletions spec/theme-spec.coffee
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
describe "Solarized One Light UI Theme", ->
themeName = 'solarized-one-light-ui'

describe "#{themeName} theme", ->
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('solarized-one-light-ui')
atom.packages.activatePackage(themeName)

it "allows the font size to be set via config", ->
expect(document.documentElement.style.fontSize).toBe ''
expect(document.documentElement.style.fontSize).toBe '12px'

atom.config.set('solarized-one-light-ui.fontSize', '10')
atom.config.set("#{themeName}.fontSize", '10')
expect(document.documentElement.style.fontSize).toBe '10px'

atom.config.set('solarized-one-light-ui.fontSize', 'Auto')
expect(document.documentElement.style.fontSize).toBe ''

it "allows the tab sizing to be set via config", ->
atom.config.set('solarized-one-light-ui.tabSizing', 'Maximum')
expect(document.documentElement.getAttribute('theme-solarized-one-light-ui-tabsizing')).toBe 'maximum'
atom.config.set("#{themeName}.tabSizing", 'Maximum')
expect(document.documentElement.getAttribute("theme-#{themeName}-tabsizing")).toBe 'maximum'

it "allows the tab sizing to be set via config", ->
atom.config.set('solarized-one-light-ui.tabSizing', 'Minimum')
expect(document.documentElement.getAttribute('theme-solarized-one-light-ui-tabsizing')).toBe 'minimum'
atom.config.set("#{themeName}.tabSizing", 'Minimum')
expect(document.documentElement.getAttribute("theme-#{themeName}-tabsizing")).toBe 'minimum'

it "allows the tab close button to be shown on the left via config", ->
atom.config.set("#{themeName}.tabCloseButton", 'Left')
expect(document.documentElement.getAttribute("theme-#{themeName}-tab-close-button")).toBe 'left'

it "allows the dock toggle buttons to be hidden via config", ->
atom.config.set('solarized-one-light-ui.hideDockButtons', true)
expect(document.documentElement.getAttribute('theme-solarized-one-light-ui-dock-buttons')).toBe 'hidden'
atom.config.set("#{themeName}.hideDockButtons", true)
expect(document.documentElement.getAttribute("theme-#{themeName}-dock-buttons")).toBe 'hidden'

it "allows the tree-view headers to be sticky via config", ->
atom.config.set("#{themeName}.stickyHeaders", true)
expect(document.documentElement.getAttribute("theme-#{themeName}-sticky-headers")).toBe 'sticky'

it "allows the tree-view headers to not be sticky via config", ->
atom.config.set("#{themeName}.stickyHeaders", false)
expect(document.documentElement.getAttribute("theme-#{themeName}-sticky-headers")).toBe null
69 changes: 64 additions & 5 deletions styles/config.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@

// Tabs ----------------------------------------------
// Theme config
// This gets changed from the theme settings

@theme-tabsizing: ~'theme-@{ui-theme-name}-tabsizing';
@theme-dockButtons: ~'theme-@{ui-theme-name}-dock-buttons';
@theme-stickyHeaders: ~'theme-@{ui-theme-name}-sticky-headers';
@theme-closeButton: ~'theme-@{ui-theme-name}-tab-close-button';

@tab-min-width: 7em; // ~ icon + 6 characters

// Tabs ----------------------------------------------

@tab-min-width: 7em; // ~ icon + 6 characters

// Even (default) ---------------
// Even (default)

.tab-bar {
.tab,
Expand All @@ -31,7 +36,7 @@
}


// Maximum (full width) ---------------
// Maximum (full width)

[@{theme-tabsizing}="maximum"] .tab-bar {
.tab,
Expand All @@ -41,7 +46,7 @@
}


// Minimum (show long paths) ---------------
// Minimum (show long paths)

[@{theme-tabsizing}="minimum"] .tab-bar {
.tab,
Expand All @@ -59,6 +64,19 @@
}


// Tabs: close button position ------------------------------

[@{theme-closeButton}="left"] {

.tab-bar .tab {
.close-icon {
right: auto;
left: @icon-padding-right;
}
}

}


// Hide docks toggle buttons ------------------------------

Expand All @@ -75,3 +93,44 @@
}

}


// Sticky Projects ------------------------------

[@{theme-stickyHeaders}="sticky"] {

.tree-view {
.project-root-header {
position: sticky;
top: 0;
z-index: 1;
padding-left: 5px;
padding-right: 10px;
border-bottom: 1px solid @base-border-color;
background-color: @tree-view-background-color;
}
.project-root.project-root {
margin-left: -5px;
margin-right: -10px;

// Disable selection
&::before {
display: none;
}

// Add selection back
&.selected .project-root-header {
background-color: @background-color-selected;
}
}
&:focus .selected .project-root-header.project-root-header {
background: @button-background-color-selected;
}

// Fix sticky header from covering auto-revealed items
.list-item.selected {
padding-top: @ui-tab-height;
margin-top: -@ui-tab-height;
}
}
}
4 changes: 2 additions & 2 deletions styles/docks.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@

// Make toggle buttons cover ^ border
.atom-dock-toggle-button.left {
margin-left: -1px;
margin-left: -2px;
}
.atom-dock-toggle-button.right {
margin-right: -1px;
margin-right: -2px;
}
.atom-dock-inner:not(.atom-dock-open) .atom-dock-toggle-button.bottom {
margin-bottom: -1px;
Expand Down
5 changes: 5 additions & 0 deletions styles/modal.less
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ atom-panel.modal {
position: relative; // fixes stacking order
}

.command-palette {
padding: 1px; // prevents the box-shadow of the input from being cut off
background-color: @overlay-background-color;
}


// Container
&:before {
Expand Down
11 changes: 11 additions & 0 deletions styles/status-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,15 @@
cursor: default;
}
}

// Remove margin for icon without text
status-bar-launch-mode::before, // Launch mode
.about-release-notes::before, // New release squirrel
.PortalStatusBarIndicator .icon::before, // Teletype
.icon.is-icon-only::before {
margin-right: 0;
}
.github-PushPull-label.is-push:empty { // GitHub package when nothing to push
margin-right: -.25em;
}
}
23 changes: 13 additions & 10 deletions styles/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,19 @@

// Active pane marker --------------

atom-pane.active .tab.active:before {
content: "";
position: absolute;
pointer-events: none;
z-index: 2;
top: 0;
left: -1px; // cover left border
bottom: 0;
width: 2px;
background: @accent-color;
atom-pane-axis > atom-pane.active,
atom-pane-container > atom-pane.pane {
.tab.active:before {
content: "";
position: absolute;
pointer-events: none;
z-index: 2;
top: 0;
left: -1px; // cover left border
bottom: 0;
width: 2px;
background: @accent-color;
}
}

// hide marker in docks
Expand Down
Loading

0 comments on commit 0cdd697

Please sign in to comment.