html
  background-color: $hl
  color: $fg
  margin: 1em

body
  background-color: $bg
  margin: 0 auto
  max-width: 23cm
  border: 1pt solid $comment
  padding: 1em

code
  background-color: $hl
  padding: 2px

a
  color: $yellow

a:visited
  color: $orange

a:hover
  color: $orange

h1
  color: $magenta

h2,h3,h4,h5,h6
  color: $green

pre
  background-color: $bg
  color: $fg
  border: 1pt solid $comment
  padding: 1em
  box-shadow: 5pt 5pt 8pt $hl
  code
    background-color: @background-color

h1
  font-size: 2.8em
h2
  font-size: 2.4em
h3
  font-size: 1.8em
h4
  font-size: 1.4em
h5
  font-size: 1.3em
h6
  font-size: 1.15em

table
  border: hidden
  border-color: $comment
  margin-left:auto;
  margin-right:auto;

colgroup
  border: 1px solid $comment

tr:nth-child(even)
  background-color: $hl

Align all headings in the center

html
  background-color: $hl
  color: $fg
  margin: 1em

body
  background-color: $bg
  margin: 0 auto
  max-width: 23cm
  border: 1pt solid $comment
  padding: 1em

code
  background-color: $hl
  padding: 2px

a
  color: $yellow

a:visited
  color: $orange

a:hover
  color: $orange

h1
  color: $magenta

h2,h3,h4,h5,h6
  color: $green
  text-align: center

pre
  background-color: $bg
  color: $fg
  border: 1pt solid $comment
  padding: 1em
  box-shadow: 5pt 5pt 8pt $hl
  code
    background-color: @background-color

h1
  font-size: 2.8em
h2
  font-size: 2.4em
h3
  font-size: 1.8em
h4
  font-size: 1.4em
h5
  font-size: 1.3em
h6
  font-size: 1.15em

table
  border: hidden
  border-color: $comment
  margin-left:auto;
  margin-right:auto;

colgroup
  border: 1px solid $comment

tr:nth-child(even)
  background-color: $hl


// Tâmia © 2013 Artem Sapegin http://sapegin.me
// Password field with toggle to show characters
// Dependencies: form

// Bones

.password
	position: relative
	display: block
	width: 100%

	&__field
		position:relative;
		width: inherit
		z-index: 90

	&__toggle
		display: none
	&.is-ok &__toggle
		position: absolute
		display: block
		top: 0
		bottom: 0
		right: 0
		cursor: pointer
		z-index: 100
		&:before
			content: ""
			position: absolute
			top: 50%
			left: 50%
			transform: translate(-50%,-50%)

	&.is-disabled &__toggle
		opacity: .4

// Default skin

modules_default_skin ?= true
password_default_skin ?= false

if modules_default_skin or password_default_skin
	.password
		&.is-ok &__toggle
			width: 20px
			&:before
				content: "a"
		&.is-ok.is-unlocked &__toggle:before
			content: "●"

Hide IE10 password visibility toggle.

// Tâmia © 2013 Artem Sapegin http://sapegin.me
// Password field with toggle to show characters
// Dependencies: form

// Bones

.password
	position: relative
	display: block
	width: 100%

	&__field
		position:relative;
		width: inherit
		z-index: 90

	&__toggle
		display: none
	&.is-ok &__toggle
		position: absolute
		display: block
		top: 0
		bottom: 0
		right: 0
		cursor: pointer
		z-index: 100
		&:before
			content: ""
			position: absolute
			top: 50%
			left: 50%
			transform: translate(-50%,-50%)

	&.is-disabled &__toggle
		opacity: .4

	// Hide IE10 password visibility toggle
	&::-ms-reveal
		display: none !important

// Default skin

modules_default_skin ?= true
password_default_skin ?= false

if modules_default_skin or password_default_skin
	.password
		&.is-ok &__toggle
			width: 20px
			&:before
				content: "a"
		&.is-ok.is-unlocked &__toggle:before
			content: "●"


@import 'cozy-ui/defaults'
@import 'cozy-ui'

.fil-content
    top-padded(30px)

    @media (max-width: (768/basefont)rem)
        padding 0

Remove outline on div :low_brightness:

@import 'cozy-ui/defaults'
@import 'cozy-ui'

div:focus
    outline: none

.fil-content
    top-padded(30px)

    @media (max-width: (768/basefont)rem)
        padding 0


// Normalize Styles
@import '../../node_modules/normalize.css/normalize.css';

// Box sizing partial styles
// Apply a natural box layout model to all elements
*,
*:before,
*:after
  -moz-box-sizing border-box
  -webkit-box-sizing border-box
  box-sizing border-box

// Screens and Modules
@import './screens/Index/components/layout/layout';
@import './screens/Index/components/index/index';

// Styling on warning for users on IE7 or below
.browsehappy
  text-align center
  margin 0
  background #fff8e2
  color #000
  padding 0.5em 0

Fix location of normalize.css in stylus template

// Normalize Styles
@import '../node_modules/normalize.css/normalize.css';

// Box sizing partial styles
// Apply a natural box layout model to all elements
*,
*:before,
*:after
  -moz-box-sizing border-box
  -webkit-box-sizing border-box
  box-sizing border-box

// Screens and Modules
@import './screens/Index/components/layout/layout';
@import './screens/Index/components/index/index';

// Styling on warning for users on IE7 or below
.browsehappy
  text-align center
  margin 0
  background #fff8e2
  color #000
  padding 0.5em 0


.editable-text
  padding-right 0px
  +above(md)
    padding-right 30px
  textarea.invisible-input
    display block
    width 100%

.character-limit
  position absolute
  top -8px
  right 5px
  font-size 12px
  color rgba(black, .5)
  +above(md)
    top -5px
.edit-icon
  position absolute
  top 3%
  right 0
  +above(md)
    right -30px

input.invisible-input,
textarea.invisible-input
  border none
  border-bottom 2px solid rgba(black, .5)
  background none
  padding 4px
  height auto
  color white
  resize none
  border-radius 0
  &:focus
    outline 0

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  color rgba(black, .5)
}
::-moz-placeholder { /* Firefox 19+ */
  color rgba(black, .5)
}
:-ms-input-placeholder { /* IE 10+ */
  color rgba(black, .5)
}
:-moz-placeholder { /* Firefox 18- */
  color rgba(black, .5)
}

Fix scrollbars on textareas in IE10

.editable-text
  padding-right 0px
  +above(md)
    padding-right 30px
  textarea.invisible-input
    display block
    width 100%

  textarea
    overflow hidden

.character-limit
  position absolute
  top -8px
  right 5px
  font-size 12px
  color rgba(black, .5)
  +above(md)
    top -5px
.edit-icon
  position absolute
  top 3%
  right 0
  +above(md)
    right -30px

input.invisible-input,
textarea.invisible-input
  border none
  border-bottom 2px solid rgba(black, .5)
  background none
  padding 4px
  height auto
  color white
  resize none
  border-radius 0
  &:focus
    outline 0

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  color rgba(black, .5)
}
::-moz-placeholder { /* Firefox 19+ */
  color rgba(black, .5)
}
:-ms-input-placeholder { /* IE 10+ */
  color rgba(black, .5)
}
:-moz-placeholder { /* Firefox 18- */
  color rgba(black, .5)
}


/* Colors */
$background-color = #000;
$normal-text = rgba(255,255,255,0.7);
$mild-blue = #4A90E2;
$green = #b3c89b;

/* Spacing */
$header-height = 70px;
$menu-width = 200px;
$min-padding = 10px;
$med-padding = 2 * $min-padding;
$lrg-padding = 2 * $med-padding;

/* Charts */
$chart-preview-height = 250px;
$chart-preview-width = 300px;

/* Responsive Breakpoints */
$base-tablet = unquote('all and (min-width: 550px)');
$base-desktop = unquote('all and (min-width: 1050px)');

Remove unused $green Stylus variable

/* Colors */
$background-color = #000;
$normal-text = rgba(255,255,255,0.7);
$mild-blue = #4A90E2;

/* Spacing */
$header-height = 70px;
$menu-width = 200px;
$min-padding = 10px;
$med-padding = 2 * $min-padding;
$lrg-padding = 2 * $med-padding;

/* Charts */
$chart-preview-height = 250px;
$chart-preview-width = 300px;

/* Responsive Breakpoints */
$base-tablet = unquote('all and (min-width: 550px)');
$base-desktop = unquote('all and (min-width: 1050px)');


.uls-trigger
  position relative
  top -2px
  margin-left 0px

.uls-menu
  margin-top 10px
  input[type=text]
    height auto

.uls-menu .uls-lcd-region-section .uls-lcd-region-title
  font-weight normal

.uls-search-label
  height 27px

.uls-filterinput
  padding-top 3px

Fix overlap of language switcher text in RTL layout

.uls-trigger
  position relative
  top -2px
  margin-left 0px
  /*@noflip*/ padding-left: 30px

.uls-menu
  margin-top 10px
  input[type=text]
    height auto

.uls-menu .uls-lcd-region-section .uls-lcd-region-title
  font-weight normal

.uls-search-label
  height 27px

.uls-filterinput
  padding-top 3px


ks-grid-fixed-col-width = 60px
ks-grid-fixed-gut-width = 20px
ks-grid-fixed-columns = 12
ks-grid-fixed-computed-total-width = ( ks-grid-fixed-col-width + ks-grid-fixed-gut-width ) * ks-grid-fixed-columns
ks-grid-fixed-total-width = ks-grid-fixed-computed-total-width

// default to fixed layout
ks-grid-config = {
    "column-width": ks-grid-fixed-col-width,
    "gutter-width": ks-grid-fixed-gut-width,
    "columns": ks-grid-fixed-columns,
    "computed-total-width": ks-grid-fixed-computed-total-width,
    "total-width": ks-grid-fixed-total-width
}

@import "grid"
@import "row"
@import "column"
@import "offset"

Refactor defaults values for gs

ks-grid-fixed-col-width = 60px
ks-grid-fixed-gut-width = 20px
ks-grid-fixed-columns = 12

ks-grid-config = {}

@import "grid"
@import "row"
@import "column"
@import "offset"

// default to fixed layout
gs()


body
  background-color $gallery

.site__navigation
  background white
  position relative
  z-index 100
  box-shadow 0px 2px 4px 0px rgba(0,0,0,0.15)
  padding .5rem
  +above(lg)
    padding 1rem 0

  img
    display inline-block
    vertical-align middle

  .btn-primary
    border-radius 0
    +above(md)
      border-radius 3px

.site__content
  padding 0

.site__mobile-navigation
  max-height 0px
  overflow hidden
  transition all 300ms linear
  padding 0 2rem

  &.open
    max-height 9999px

Remove border from nav svg on IE10

body
  background-color $gallery

.site__navigation
  background white
  position relative
  z-index 100
  box-shadow 0px 2px 4px 0px rgba(0,0,0,0.15)
  padding .5rem
  +above(lg)
    padding 1rem 0

  img
    display inline-block
    vertical-align middle
    border none

  .btn-primary
    border-radius 0
    +above(md)
      border-radius 3px

.site__content
  padding 0

.site__mobile-navigation
  max-height 0px
  overflow hidden
  transition all 300ms linear
  padding 0 2rem

  &.open
    max-height 9999px


.g-search-results-title-container
  display block
  padding 0.5% 0 0.5% 2%
  font-size 20px
  background-color #eaebea
  border-bottom 1px solid #ddd
  color #555

  .g-search-results-title-element
    display inline-block

.g-search-results-type-container
  display block
  margin 2px 0
  border 1px solid #efefef
  border-radius 5px

  .g-search-result-type-header
    display inline-block
    font-size 17px

  .g-search-result-type-icon
    padding 0.5% 1%

  ul.g-search-results-type
    margin 0
    padding 0

  .g-search-result
    list-style none
    padding 0.15% 0 0.15% 2%
    border-top 1px solid #efefef
    color #337ab7
    font-size 15px

    &:hover
      background-color #eee

  .g-search-results-paginate

    ul.pagination
      margin 5px 15px

.g-search-pending
  padding 10px
  font-size 30px

.g-search-no-results
    padding 0.5% 0 0.5% 1%
    border 1px solid #efefef
    font-size 15px

Adjust the title position of the search results page

.g-search-results-title-container
  display block
  padding 0.5% 0 0.5% 0.5%
  font-size 20px
  background-color #eaebea
  border-bottom 1px solid #ddd
  color #555

  .g-search-results-title-element
    display inline-block

.g-search-results-type-container
  display block
  margin 2px 0
  border 1px solid #efefef
  border-radius 5px

  .g-search-result-type-header
    display inline-block
    font-size 17px

  .g-search-result-type-icon
    padding 0.5% 1%

  ul.g-search-results-type
    margin 0
    padding 0

  .g-search-result
    list-style none
    padding 0.15% 0 0.15% 2%
    border-top 1px solid #efefef
    color #337ab7
    font-size 15px

    &:hover
      background-color #eee

  .g-search-results-paginate

    ul.pagination
      margin 5px 15px

.g-search-pending
  padding 10px
  font-size 30px

.g-search-no-results
  padding 0.5% 0 0.5% 1%
  border 1px solid #efefef
  font-size 15px


// Core variables and mixins
@import 'bootstrap/variables'
@import 'bootstrap/mixins'

// Reset and dependencies
@import 'bootstrap/normalize'
@import 'bootstrap/print'
@import 'bootstrap/glyphicons'

// Core CSS
@import 'bootstrap/scaffolding'
@import 'bootstrap/utilities'
@import 'bootstrap/type'
//@import 'bootstrap/code'
@import 'bootstrap/grid'
// @import 'bootstrap/tables'
@import 'bootstrap/forms'
@import 'bootstrap/buttons'

// Components
// @import 'bootstrap/component-animations'
// @import 'bootstrap/dropdowns'
@import 'bootstrap/button-groups'
@import 'bootstrap/input-groups'
@import 'bootstrap/navs'
@import 'bootstrap/navbar'
// @import 'bootstrap/breadcrumbs'
// @import 'bootstrap/pagination'
// @import 'bootstrap/pager'
@import 'bootstrap/labels'
// @import 'bootstrap/badges'
// @import 'bootstrap/jumbotron'
@import 'bootstrap/thumbnails'
@import 'bootstrap/alerts'
@import 'bootstrap/progress-bars'
// @import 'bootstrap/media'
// @import 'bootstrap/list-group'
@import 'bootstrap/panels'
@import 'bootstrap/responsive-embed'
// @import 'bootstrap/wells'
@import 'bootstrap/close'

// Utility classes
@import 'bootstrap/responsive-utilities'

Comment out more unused components

// Core variables and mixins
@import 'bootstrap/variables'
@import 'bootstrap/mixins'

// Reset and dependencies
@import 'bootstrap/normalize'
@import 'bootstrap/print'
@import 'bootstrap/glyphicons'

// Core CSS
@import 'bootstrap/scaffolding'
@import 'bootstrap/utilities'
@import 'bootstrap/type'
//@import 'bootstrap/code'
@import 'bootstrap/grid'
@import 'bootstrap/tables'
@import 'bootstrap/forms'
@import 'bootstrap/buttons'

// Components
// @import 'bootstrap/component-animations'
// @import 'bootstrap/dropdowns'
// @import 'bootstrap/button-groups'
// @import 'bootstrap/input-groups'
// @import 'bootstrap/navs'
// @import 'bootstrap/navbar'
// @import 'bootstrap/breadcrumbs'
// @import 'bootstrap/pagination'
// @import 'bootstrap/pager'
// @import 'bootstrap/labels'
// @import 'bootstrap/badges'
// @import 'bootstrap/jumbotron'
// @import 'bootstrap/thumbnails'
// @import 'bootstrap/alerts'
// @import 'bootstrap/progress-bars'
// @import 'bootstrap/media'
// @import 'bootstrap/list-group'
// @import 'bootstrap/panels'
// @import 'bootstrap/responsive-embed'
// @import 'bootstrap/wells'
// @import 'bootstrap/close'

// Utility classes
@import 'bootstrap/responsive-utilities'


.BlogPost
  // Classes come through with Jekyll generated HTML
  // Not going to bother with correcting *that*
  // So for now, force things to look correct

  .post
    //

    > .post-header
      collapsed-margins(2em)

      > .post-category-title
        collapsed-margins(2em)

        > h1
          margin 0
          text-align center
          font-size font-size-h2
          font-weight normal

      > .post-author
      > .post-meta
        text-align center
        font-size font-size-base
        line-height line-height-base

      > .post-author
        font-weight bold

    > .post-content
      //

      p
        collapsed-margins(1em)
        font-size font-size-base
        line-height line-height-tall

        > a, > strong a
          text-decoration underline

      img
      iframe
        display block
        max-width 100%
        vertical-align bottom
        border 1px solid colors-gray-border
        margin 2em auto

      iframe
        box-shadow 4px 4px 4px colors-gray-background
        height 2150px !important
        padding 1px
        +below(400px)
          height 2000px !important
        +below(380px)
          height 1950px !important
        +below(340px)
          height 1700px !important

      h2
        collapsed-margins(4em)

      hr
        height 2px
        background-color colors-gray-border
        border none

Make it a normal a selector

.BlogPost
  // Classes come through with Jekyll generated HTML
  // Not going to bother with correcting *that*
  // So for now, force things to look correct

  .post
    //

    > .post-header
      collapsed-margins(2em)

      > .post-category-title
        collapsed-margins(2em)

        > h1
          margin 0
          text-align center
          font-size font-size-h2
          font-weight normal

      > .post-author
      > .post-meta
        text-align center
        font-size font-size-base
        line-height line-height-base

      > .post-author
        font-weight bold

    > .post-content
      //

      p
        collapsed-margins(1em)
        font-size font-size-base
        line-height line-height-tall

        a
          text-decoration underline

      img
      iframe
        display block
        max-width 100%
        vertical-align bottom
        border 1px solid colors-gray-border
        margin 2em auto

      iframe
        box-shadow 4px 4px 4px colors-gray-background
        height 2150px !important
        padding 1px
        +below(400px)
          height 2000px !important
        +below(380px)
          height 1950px !important
        +below(340px)
          height 1700px !important

      h2
        collapsed-margins(4em)

      hr
        height 2px
        background-color colors-gray-border
        border none


.footer--info
  height 240px
  text-align center
  &__menu
    position relative
    top 60%
    transform translateY(-60%)
    a
      font-weight bold
      margin 0 unit
      border-bottom none !important
    &__logo
      margin-top unit * 2
  +mobile()
    &__menu
      text-align center
      a
        display block
        margin unit (unit * 3)
      &__logo
        text-align center

Adjust footer styling for mobile

.footer--info
  height 240px
  text-align center
  &__menu
    position relative
    top 60%
    transform translateY(-60%)
    a
      font-weight bold
      margin 0 unit
      border-bottom none !important
    &__logo
      margin-top unit * 2
  +mobile()
    padding-top (unit * 5)
    &__menu
      text-align center
      a
        display block
        margin unit (unit * 3)
      &__logo
        text-align center


@require './default'
@require './divider'
@require './draggable'
@require './fill'
@require './overlay'
@require './invisible'
@require './channel'
@require './sizes'
@require './secondary'
@require './thick'

Fix reference to button style

@require './default'
@require './divider'
@require './draggable'
@require './fill'
@require './overlay'
@require './invisible'
@require './channel'
@require './sizes'
@require './secondary'
@require './heavy'


.huge
  font-size 40px

.panel-trending, .panel-new, .panel-updated, .panel-popular
  .panel-heading
    color #fff
  ul
    margin 0
    padding 10px
    list-style none
    li
      a
        text-decoration none

.panel-trending
  border-color: color-panel-trending
  .panel-heading
    border-color color-panel-trending
    background-color color-panel-trending
  a
    color color-panel-trending
    &:hover
      color color-panel-trending-a-hover

.panel-new
  border-color: color-panel-new
  .panel-heading
    border-color color-panel-new
    background-color color-panel-new
  a
    color color-panel-new
    &:hover
      color color-panel-new-a-hover

.panel-updated
  border-color: color-panel-updated
  .panel-heading
    border-color color-panel-updated
    background-color color-panel-updated
  a
    color color-panel-updated
    &:hover
      color color-panel-updated-a-hover

.panel-popular
  border-color: color-panel-popular
  .panel-heading
    border-color color-panel-popular
    background-color color-panel-popular
  a
    color color-panel-popular
    &:hover
      color color-panel-popular-hover

Fix a:hover color on `Popular Plugins` box

.huge
  font-size 40px

.panel-trending, .panel-new, .panel-updated, .panel-popular
  .panel-heading
    color #fff
  ul
    margin 0
    padding 10px
    list-style none
    li
      a
        text-decoration none

.panel-trending
  border-color: color-panel-trending
  .panel-heading
    border-color color-panel-trending
    background-color color-panel-trending
  a
    color color-panel-trending
    &:hover
      color color-panel-trending-a-hover

.panel-new
  border-color: color-panel-new
  .panel-heading
    border-color color-panel-new
    background-color color-panel-new
  a
    color color-panel-new
    &:hover
      color color-panel-new-a-hover

.panel-updated
  border-color: color-panel-updated
  .panel-heading
    border-color color-panel-updated
    background-color color-panel-updated
  a
    color color-panel-updated
    &:hover
      color color-panel-updated-a-hover

.panel-popular
  border-color: color-panel-popular
  .panel-heading
    border-color color-panel-popular
    background-color color-panel-popular
  a
    color color-panel-popular
    &:hover
      color color-panel-popular-a-hover


Add relative font url imports (not used atm atm).

// These will not work if docs are file://local
@css {
  @import url('///fonts.googleapis.com/css?family=Inconsolata');
  @import url('///fonts.googleapis.com/css?family=PT+Sans');
  @import url('///fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700');
}


@require '../clock'

artwork-banner = {
  height: 66px
}

.artwork-banner
  height: artwork-banner.height
  display flex
  flex-direction row
  justify-content space-between
  align-items center
  block-margins(10px)
  text-align left
  border-bottom 1px solid gray-lighter-color

  &__logo
    margin-right 10px
    padding-right @margin-right
    border-right 1px solid gray-lighter-color

  &__name
    flex 1
    garamond-size('s-headline')
    > a
      display block
      text-decoration none

  &__jump
    //

Align banner to visual baseline

@require '../clock'

.artwork-banner
  display flex
  flex-direction row
  justify-content space-between
  align-items flex-end
  block-margins(gutter / 2)
  padding (gutter / 2) 0
  text-align left
  border-bottom 1px solid gray-lighter-color

  &__logo
    margin-right (gutter / 2)
    padding-right @margin-right
    border-right 1px solid gray-lighter-color

  &__name
    position relative
    flex 1
    garamond-size('s-headline')
    margin-bottom -9px // Compensates to align baseline
    white-space nowrap
    overflow hidden

    &:after
      display block
      content ''
      position absolute
      top 0
      right 0
      bottom 0
      width (gutter * 3)
      background-image linear-gradient(left, rgba(white, 0), white)

    > a
      display block
      text-decoration none

  &__countdown
    margin 0 (gutter / 2)
    margin-bottom -2px // Compensates to align baseline

  &__jump
    > a
      white-space nowrap


Move the menu stylus module to a different folder for better organization

.menu-toggle
  display none

.menu
  position fixed
  width 180px
  top 0
  bottom 0
  background rgb(37, 42, 58)
  color lightgray
  overflow auto

.menu-links
  margin 0
  padding 0 0 20px 0
  display flex
  flex-direction column
  height 100%
  li
    list-style none
    overflow hidden

.menu-link,
.menu-submenulink
  color lightgray
  text-decoration none
  transition color ease 0.2s
  width 100%
  display block
  box-sizing: border-box;
  &:hover
    background-color rgba(11, 16, 31, 0.4)

.menu-link
  padding 15px 0 15px 15px

.menu-submenulink
  padding 15px 0 15px 15px

.menu-link-active
  border-right 5px solid #F2F2F2
  background-color rgba(11, 16, 31, 0.2)

.menu-link-last
  margin-bottom 20px

.menu-link-active ~ .menu-submenu
  display block

.menu-submenu
  display none
  padding 0
  background #1A1F2F


/*
 * zindex.styl -- contains variables for each CSS z-index value.
 *
 * Any time you would reference a z-index in CSS, you should instead be using a
 * variable defined in either this file or a project-specific z-index file.
 * This allows for consistency and predictability in z-index definition and
 * use.
 *
 * Each value we use is defined on the scale below, but the scale should never
 * be used directly. Instead, different applications of the scale should be
 * stored as their own variables, grouped and sorted by valur, to allow for
 * quick scanning and debugging of layering issues.
 *
 * The $zindex-10 value is reserved for debugging, via $zindex-dev.
 *
 * Shamelessly inspired by Medium:
 * https://gist.github.com/fat/1f6da6b3bd0311a1f8a0
 */

// z-index scale
$zindex-1 = 10;
$zindex-2 = 20;
$zindex-3 = 30;
$zindex-4 = 40;
$zindex-5 = 50;
$zindex-6 = 60;
$zindex-7 = 70;
$zindex-8 = 80;
$zindex-9 = 90;
$zindex-10 = 100;

// z-index applications
$zindex-dev = $zindex-10;


@import 'cozy-ui'

.pho-create-album-form
    @extend $form-text

    .coz-create-album-label
        display        block
        margin-bottom  .5em

        text-transform uppercase
        color          #92a0b2
        font-size      .75em
        padding        .55em 0

    .coz-inline-form
        display     flex
        align-items stretch
        width       100%

        .coz-input-text
            flex-grow    1

        .coz-input-text,
        .coz-btn
            font-size  1em
            height     4em
            align-self stretch

        .coz-btn
            margin-right 0
            padding-left 2.5em
            padding-right 2.5em

Fix visual enlargement when the create album button has spinner

@import 'cozy-ui'

.pho-create-album-form
    @extend $form-text

    .coz-create-album-label
        display        block
        margin-bottom  .5em

        text-transform uppercase
        color          #92a0b2
        font-size      .75em
        padding        .55em 0

    .coz-inline-form
        display     flex
        align-items stretch
        width       100%

        .coz-input-text
            flex-grow    1

        .coz-input-text,
        .coz-btn
            font-size  1em
            height     4em
            align-self stretch

        .coz-btn
            margin-right 0
            padding-left 2.5em
            padding-right 2.5em

            &[aria-busy=true]
                padding-right 1em


@require '../stylus_lib'
@require '../artwork_brick'

.artwork-brick--auction
  .artwork-brick__metadata
    height inherit

    &__sale-artwork
      //

      &__current-bid
        sans('body')
        m = (gutter / 1.5)
        margin distance(m) 0 (m)
        color black

      &__buttons > a
        inline-block-margins(gutter / 5)
        min-width (gutter * 3)

Increase margins for stacked auction artwork bricks

@require '../stylus_lib'
@require '../artwork_brick'

.artwork-brick--auction
  .artwork-brick__metadata
    height inherit
    serif('l-caption')
    margin distance(gutter / 2) 0 distance(gutter * 2) 0

    &__sale-artwork
      //

      &__current-bid
        sans('body')
        m = (gutter / 1.5)
        margin distance(m) 0 (m)
        color black

      &__buttons > a
        inline-block-margins(gutter / 5)
        min-width (gutter * 3)


Add variables and mixin for media queries

//Width for media queries
$mobile-min = 320px
$mobile-max = 480px

$tab-min = 768px
$tab-max = 900px

$desktop = 1200px

//Media queries mixin definition
media-queries = {
  mobile1 : "screen and (min-width: $mobile-min)",
  mobile1_only : "screen and (min-width: $mobile-min) and (max-width: $mobile-max)"
  mobile2 : "screen and (min-width: $mobile-max)",
  mobile2_only : "screen and (min-width: $mobile-max) and (max-width: $tab-min)"
  tab1 : "screen and ($min-width: tab-min)",
  tab1_only : "screen and (min-width: $tab-min) and (max-width: $tab-max)"
  tab2 : "screen and ($min-width: tab-max)",
  tab2_only : "screen and (min-width: $tab-max) and (max-width: $desktop)"
  desktop : "screen and ($min-width: desktop)"
}

//Call this mixin like this:
//+for-device(mobile1 mobile2 <other keys from media-queries>)
//  <css here>
for_device(devices)
  conditions = ()
  for device in devices
    push(conditions, media-queries[device])
  conditions = join(', ', conditions)
  @media conditions
    {block}


@media screen and (max-width: 768px)
  .buy-art-header
    justify-content center
    height 460px
    &__title
      garamond-size('l-headline', true)
      max-width inherit
      margin-bottom 20px

  .buy-art-intro
    height 560px
   &__stat_container
      width 320px
      height 85px
    &__title
      max-width 280px
      garamond-size('headline', true)
    &__subtitle
      max-width 280px
      margin 0 auto
      garamond-size('l-body', true)
    &__stat-number
      garamond-size('s-headline', true)

  .buy-art-benefits
    &__benefits-container
      max-width inherit
      margin-top 35px
      padding-bottom 35px
    &__title
      garamond-size('headline', true)
    &__items
      img
        margin-bottom 10px
      margin-bottom 35px

  .buy-art-faqs
    margin-bottom 60px
    &__title
      garamond-size('headline')
    &__items-container
      padding-top 25px
    &__item-title
      garamond-size('s-body')
      font-weight bold
      margin-bottom 0
    &__item-content
      garamond-size('s-body')
      margin-bottom 35px
    &__item-grid
      margin-right inherit

  .buy-art-footer
    &__title
      garamond-size('headline')
      margin-right auto
      margin-left auto

Fix media query CSS for introduction


@import nib

a
    cursor pointer

a.disabled
    cursor none
    pointer-events none
    color #999

a.disabled:hover
    background-color transparent

.link-spacer
    opacity 0.2
    padding 0px 5px

#top-level-nav
    visibility hidden

html.light-theme, html.dark-theme

    #top-level-nav
        visibility visible

.subtle
    opacity 0.5

.ellipsis
    overflow ellipsis

.hard-wrap
    word-wrap break-word

tr.filtered
    display none

// Overrides

#nav-user-name
    cursor default

.btn-navbar:hover
    background-position initial
    transition none

.navbar .btn-navbar:active
    box-shadow inset 0px 1px 3px rgba(0, 0, 0, 0.2)

.navbar-fixed-top .brand
    transition none

.navbar .nav > li > a
    padding 10px 10px 11px

table th
    text-align left

.well

    table
        margin-bottom 0px

    h2
        margin-bottom 10px
        overflow ellipsis

    &.well-nav
        padding 8px 0

.modal
    position fixed
    top 20%
    margin-top 0px

@media (max-width: 480px)

    .well

        h2
            margin-top 0px

    .modal
        position fixed
        top 10px

#page
    padding-bottom: 40px

Add `.filtered` styling for `table`s (in addition to `tr`s)

@import nib

a
    cursor pointer

a.disabled
    cursor none
    pointer-events none
    color #999

a.disabled:hover
    background-color transparent

.link-spacer
    opacity 0.2
    padding 0px 5px

#top-level-nav
    visibility hidden

html.light-theme, html.dark-theme

    #top-level-nav
        visibility visible

.subtle
    opacity 0.5

.ellipsis
    overflow ellipsis

.hard-wrap
    word-wrap break-word

tr.filtered
    display none

table.filtered
    display none

// Overrides

#nav-user-name
    cursor default

.btn-navbar:hover
    background-position initial
    transition none

.navbar .btn-navbar:active
    box-shadow inset 0px 1px 3px rgba(0, 0, 0, 0.2)

.navbar-fixed-top .brand
    transition none

.navbar .nav > li > a
    padding 10px 10px 11px

table th
    text-align left

.well

    table
        margin-bottom 0px

    h2
        margin-bottom 10px
        overflow ellipsis

    &.well-nav
        padding 8px 0

.modal
    position fixed
    top 20%
    margin-top 0px

@media (max-width: 480px)

    .well

        h2
            margin-top 0px

    .modal
        position fixed
        top 10px

#page
    padding-bottom: 40px


.channel-embed
  &__header
    &__logo svg
      padding-top 5px
      width 27px
      height 30px
      fill textgray
    .path__inner
      padding (unit / 2) 0
      border-bottom 1px solid bordergray
      margin 0 10px unit
    .path__headline
      margin-bottom 0
      font-size 1.25rem
      display flex
      float none
      align-items center
      justify-content space-between
  @media (min-width:(block_width_mar * 3) + 20) and (max-width:(block_width_mar * 4) + 20)
    .block-collection
      .block-item:nth-of-type(1n+6):not(.grid__block--embedded)
        display none
  @media (min-width:(block_width_mar * 2) + 20) and (max-width:(block_width_mar * 3) + 20)
    .block-collection
      .block-item:nth-of-type(1n+4):not(.grid__block--embedded)
        display none
  @media (min-width:0) and (max-width:(block_width_mar * 2) + 20)
    .block-collection
      .block-item:nth-of-type(1n+3):not(.grid__block--embedded)
        display none


ul
ol
    margin 0
    padding 0
    list-style-type none

/*
    // This form of extends is not available yet in stylus.
    // TODO cf. https://github.com/LearnBoost/stylus/pull/1536

    &$sz-default-ul
        margin-bottom sz-base-spacing / 2
        padding-left sz-base-spacing
        list-style-type disc

    &$sz-default-ol
        margin-bottom sz-base-spacing / 2
        padding-left sz-base-spacing
        list-style-type decimal
*/

$sz-default-ul
    margin-bottom sz-base-spacing / 2
    padding-left sz-base-spacing
    list-style-type disc

$sz-default-ol
    margin-bottom sz-base-spacing / 2
    padding-left sz-base-spacing
    list-style-type decimal

dl
    margin-bottom sz-base-spacing / 2

    dt
        font-weight bold
        margin-top sz-base-spacing / 2

    dd
        margin 0


table
    width 100%
    margin ( sz-base-spacing / 2 ) 0
    table-layout fixed
    border-collapse collapse

th
    padding ( sz-base-spacing / 2 ) 0
    border-bottom 1px solid darken( sz-base-border-color, 15 )
    font-weight bold
    text-align left

td
    padding ( sz-base-spacing / 2 ) 0
    border-bottom sz-base-border

tr
td
th
    vertical-align middle


//
// <%= pkg.name.slug %>.<%= dtv.name.camel %>
//
// (c) <%= (new Date).getFullYear() %> <%= author.name %> (<%= author.email %>)
//
// SPDX-License-Identifier: <%= pkg.license %>
//                          (http://spdx.org/licenses/<%= pkg.license %>.html)
//

// injector:stylus:begin
// injector:stylus:end


// Random Stylesheet for testing, with no mark

$pixelBase = 10

u( $values )
    $list = unquote( "" )
    $unit = ""

    for $value in $values
        if ( $value == "auto" ) or ( $value == "inherit" )
            $unit = "string"
        else
            $unit = unit( $value )

        if ( $value == 0 ) or ( $unit != "" )
            append( $list, $value )
        else
            if $usePixels
                append( $list, unit( $value, "px" ) )
            else
                append( $list, unit( ( $value / $pixelBase ), "rem" ) )

    return $list

fslh( $font-size, $line-height )
    return unquote( "" + u( $font-size ) + "/" + u( $line-height ) + "" )

centering( $position = absolute, $top = 0, $right = 0, $bottom = 0, $left = 0, $margin = auto )
    position: $position
    top: $top
    right: $right
    bottom: $bottom
    left: $left
    margin: $margin


.y-create-model-dialog
  .y-dialog-margin
    dock(15px, 20px, 5px, 20px)

  .y-dialog-content
    overflow auto
    dock(0, 0, 50px, 0)

  .y-algorithms
    overflow auto
    dock(0, 0, 10px, 0)

  .y-algorithm
    cursor pointer

  .y-algorithm-title
    font-weight 300
    font-size 20px

  .y-validation-error
    padding 10px

  .y-model-parameter
    td
      vertical-align top
      padding 5px

    .y-description
      color #888

    input:focus, select:focus
      outline none !important
      box-shadow none !important

    input[type="text"]
      border 1px solid #ddd
      &:focus
        border-color #999

    label.y-input-inline
      text-transform uppercase
      font-size 11px
      margin-right 3px

    &.y-invalid
      input[type="text"]
        border-color red
        &:focus
          border-color red

      label
        border-bottom 1px dotted red

    &:hover
      .y-description
        color inherit

  // TODO Duplicate of y-import-actions
  .y-model-actions
    dock-bottom(40px)
    line-height 40px
    text-align right
    border-top 1px solid #ddd

Make multi-list styling consistent with other dialog controls

.y-create-model-dialog
  .y-dialog-margin
    dock(15px, 20px, 5px, 20px)

  .y-dialog-content
    overflow auto
    dock(0, 0, 50px, 0)

  .y-algorithms
    overflow auto
    dock(0, 0, 10px, 0)

  .y-algorithm
    cursor pointer

  .y-algorithm-title
    font-weight 300
    font-size 20px

  .y-validation-error
    padding 10px

  .y-model-parameter
    td
      vertical-align top
      padding 5px

    .y-description
      color #888

    input:focus, select:focus
      outline none !important
      box-shadow none !important

    input[type="text"]
      border 1px solid #ddd
      &:focus
        border-color #999

        select[multiple], select[size]
      width 100%
      border 1px solid #ddd
      &:focus
        border-color #999

    label.y-input-inline
      text-transform uppercase
      font-size 11px
      margin-right 3px

    &.y-invalid
      input[type="text"]
        border-color red
        &:focus
          border-color red

      label
        border-bottom 1px dotted red

    &:hover
      .y-description
        color inherit

  // TODO Duplicate of y-import-actions
  .y-model-actions
    dock-bottom(40px)
    line-height 40px
    text-align right
    border-top 1px solid #ddd


Move page progress base styles here from forum

@import "nodeca.core/client/common/_variables"

.page-progress
  padding 0
  margin 0

.page-progress__item
  display inline-block
  vertical-align middle

.page-progress__button-first
.page-progress__button-last
  display block
  position relative
  padding 0 10px
  height 50px
  line-height 50px
  color grayDark
  &:hover
    text-decoration none

.page-progress__info
  display block
  position relative
  font-size 12px
  padding 15px 0
  height 50px
  color grayDark
  &:hover
    text-decoration none

.page-progress__bar
  width 100%
  background-color grayLighter

.page-progress__bar-fill
  background-color grayDark
  height 2px
  transition width .3s

.page-progress__menu
  min-width 150px
  padding 7px 10px

//
// Highlight on hover
//
.page-progress__button-first
.page-progress__button-last
.page-progress__info
  &:after
    position absolute
    left 0
    right 0
    bottom 0
    height 2px
    content ''
    background-color grayLighter
    opacity 0
    transition opacity .3s

.page-progress__item:hover
  .page-progress__button-first
  .page-progress__button-last
  .page-progress__info
    &:after
      opacity 1


.list-group
  margin-left: 0
  padding-left: 0

.list-inline
  li
    display: inline-block
    margin-right: 5px
    &:last-child
      margin-right: 0


@require 'cozy-ui'

$toolbar-height = em(96px)

.pho-viewer-wrapper
    background      grey-08
    height          100vh
    width           100vw
    color           white
    display         flex
    flex-direction  column
    overflow        hidden
    position        fixed
    left            0
    top             0
    z-index         100

    &::after
        content     ''
        height      $toolbar-height
        flex-shrink 0

    .pho-viewer-content
        display         flex
        flex-direction  row
        flex-grow       1

        .photo-viewer-nav-previous, .photo-viewer-nav-next
            width            em(75px)
            flex-shrink      0

        .pho-viewer-photo
            flex-grow       1
            display         flex
            position        relative
            justify-content center
            align-items     center

            img
                position   absolute
                top        50%
                transform  translateY(-50%)
                max-height 100%
                max-width  100%
                box-shadow 0 6px 24px 0 rgba(0, 0, 0, 0.5)
                display    block

Fix picture not centered correctly in some browsers

@require 'cozy-ui'

$toolbar-height = em(96px)

.pho-viewer-wrapper
    background      grey-08
    height          100vh
    width           100vw
    color           white
    display         flex
    flex-direction  column
    overflow        hidden
    position        fixed
    left            0
    top             0
    z-index         100

    &::after
        content     ''
        height      $toolbar-height
        flex-shrink 0

    .pho-viewer-content
        display         flex
        flex-direction  row
        flex-grow       1

        .photo-viewer-nav-previous, .photo-viewer-nav-next
            width            em(75px)
            flex-shrink      0

        .pho-viewer-photo
            flex-grow       1
            display         flex
            position        relative
            justify-content center
            align-items     center

            img
                position   absolute
                top        50%
                left       50%
                transform  translate(-50%, -50%)
                max-height 100%
                max-width  100%
                box-shadow 0 6px 24px 0 rgba(0, 0, 0, 0.5)
                display    block


@require 'cozy-ui'

.settings
    margin 0 1em

    .settings__subcategory-title
        display       block
        margin-bottom 0
        font-weight   normal

    .settings__subcategory
        display flex

    .settings__subcategory__label
        color       gray
        font-size(12px)

    .settings__subcategory__item
        flex-grow  1
        text-align right

    .settings__button-danger
        @extend $button
        width 100%
        margin 0
        color pomegranate
        border-color pomegranate

.media-uploading
    @extend $icon-16
    @extend $icon-spinner-blue
    margin-left 0.5em

Add margin after unlink button :art:

@require 'cozy-ui'

.settings
    margin 0 1em

    .settings__subcategory-title
        display       block
        margin-bottom 0
        font-weight   normal

    .settings__subcategory
        display flex

    .settings__subcategory__label
        color       gray
        font-size(12px)

    .settings__subcategory__item
        flex-grow  1
        text-align right

    .settings__button-danger
        @extend $button
        width 100%
        margin 0 0 10px
        color pomegranate
        border-color pomegranate

.media-uploading
    @extend $icon-16
    @extend $icon-spinner-blue
    margin-left 0.5em


Add typography setup (from bourbon/bitters)

// Sizo Typography

body
    background-color sz-base-background-color
    font-family sz-base-font-family
    font-size sz-base-font-size
    -webkit-font-smoothing antialiased
    color sz-base-font-color
    line-height sz-base-line-height

h1
h2
h3
h4
h5
h6
    margin 0
    font-family sz-header-font-family
    line-height sz-header-line-height
    text-rendering optimizeLegibility

h1
    font-size sz-h1-font-size

h2
    font-size sz-h2-font-size

h3
    font-size sz-h3-font-size

h4
    font-size sz-h4-font-size

h5
    font-size sz-h5-font-size

h6
    font-size sz-h6-font-size

p
    margin 0 0 ( sz-base-spacing / 2 )

a
    color sz-base-link-color
    text-decoration none
    transition color 0.1s linear

    &:hover
        color sz-hover-link-color

    &:active
    &:focus
        color sz-hover-link-color
        outline none

hr
    margin sz-base-spacing 0
    border-bottom sz-base-border
    border-left none
    border-right none
    border-top none

img
picture
    max-width 100%
    margin 0

blockquote
    margin sz-base-spacing 0
    padding-left sz-base-spacing / 2
    border-left 2px solid sz-base-border-color
    color lighten( sz-base-font-color, 15 )

cite
    font-style italic
    color lighten( sz-base-font-color, 25 )

    &:before
        content "\2014 \00A0"


header
    // display flex
    background-color $node-gray
    text-align center

    > .container
        overflow visible

    li
        position relative
        padding-bottom 12px;

        &.active:after
            $border-width = 14px
            top 100%
            left 50%
            border solid rgba(0, 0, 0, 0)
            content " "
            height 0
            width 0
            position absolute
            pointer-events none
            border-color rgba(3, 3, 0, 0)
            border-top-color $node-gray
            border-width $border-width
            margin-left -($border-width/2)px

    a,
    a:link,
    a:active
        padding 0 12px
        text-transform uppercase
        font-size 14px
        color #ccc !important

    a:hover
        background-color transparent
        text-decoration underline

#logo
    width 182px
    margin 30px auto

Fix active arrow on first menu item

header
    // display flex
    background-color $node-gray
    text-align center

    > .container
        overflow visible

    li
        $border-width = 14px
        position relative
        padding-bottom 12px;

        &.active:after
            top 100%
            left 50%
            border solid rgba(0, 0, 0, 0)
            content " "
            height 0
            width 0
            position absolute
            pointer-events none
            border-color rgba(3, 3, 0, 0)
            border-top-color $node-gray
            border-width $border-width
            margin-left -($border-width/2)px

        &.active:first-child:after
            margin-left -($border-width)px

    a,
    a:link,
    a:active
        padding 0 12px
        text-transform uppercase
        font-size 14px
        color #ccc !important

    a:hover
        background-color transparent
        text-decoration underline

#logo
    width 182px
    margin 30px auto


/*********************************\
 Components / Luna Sprite
\*********************************/

.c-luna-sprite__container
  position absolute
  left 0
  width 100%
.c-luna-sprite__sprite
  position absolute
  width 60px
  height 51px
  z-index Z-ANIMATIONS
  background url('images/luna-boot-scoot.png') 0 0
  animation play-luna-boot-scoot 600ms steps(4) infinite,
            play-across-window 10s linear infinite
@keyframes play-luna-boot-scoot
  0% {
    background-position 0 0
  }
  100% {
    background-position -240px
  }
@keyframes play-across-window
  0% {
    right -60px
  }
  100% {
    right calc(100% + 60px)
  }

Add flip and return animation for Luna_sprite

/*********************************\
 Components / Luna Sprite
\*********************************/

.c-luna-sprite__container
  position absolute
  left 0
  width 100%
.c-luna-sprite__sprite
  position absolute
  width 60px
  height 51px
  z-index Z-ANIMATIONS
  background url('images/luna-boot-scoot.png') 0 0
  animation play-luna-boot-scoot 600ms steps(4) infinite,
            play-across-window__small 20s linear infinite
@keyframes play-luna-boot-scoot
  0% {
    background-position 0 0
  }
  100% {
    background-position -240px
  }
@keyframes play-across-window__small
  0% {
    right -60px
    transform scaleX(1)
  }
  50% {
    right calc(100% + 60px)
    transform scaleX(1)
  }
  51% {
    transform scaleX(-1)
  }
  100% {
    right -60px
    transform scaleX(-1)
  }


// Circle control for Share and Save buttons.
.circle-control-container
  display inline-block
  width 53px
  height @width
  border-size 2px
  border @border-size solid dark-gray-border-color
  border-radius (@width / 2)
  text-align center
  line-height @width - @border-size * 2
  vertical-align top
  cursor pointer
  [class^="icon-"]
    line-height inherit
  &:hover
    background-color dark-gray-text-color
    border-color dark-gray-text-color
    color white
  &[data-state="active"]
    background-color highlight-color
    border-color highlight-color
    color white


.sortTable

    th
        cursor pointer

    th.sorttable_sorted, th.sorttable_sorted_reverse
        background rgba(0, 0, 0, .05)
        position relative

    th.sorttable_sorted #sorttable_sortfwdind, th.sorttable_sorted_reverse #sorttable_sortrevind
        text-indent -99999px
        display inline-block
        height 0
        width 0
        border-width 5px
        border-style solid
        border-color transparent
        position absolute
        margin auto
        right 8px

    th.sorttable_sorted #sorttable_sortfwdind
        border-top-color inherit
        top 4px
        bottom 0

    th.sorttable_sorted_reverse #sorttable_sortrevind
        border-bottom-color inherit
        top 0
        bottom 4px


/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7
import MeeGo.Labs.Components 0.1 as Labs

TextEdit {
    Labs.CCPContextArea {
        editor: parent
    }
}

Comment the CCPContextArea for now

/*
 * Copyright 2011 Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import Qt 4.7
import MeeGo.Labs.Components 0.1 as Labs

TextEdit {
    /*Labs.CCPContextArea {
        editor: parent
    }*/
}


import qbs 1.0

Project {
    minimumQbsVersion: "1.6"
    qbsSearchPaths: ["qbs-resources"]
    property bool withCode: true
    property bool withDocumentation: true
    property bool withExamples: false
    property bool withTests: withCode
    property stringList autotestArguments: []
    property stringList autotestWrapper: []

    references: [
        "docker/docker.qbs",
        "share/share.qbs",
        "scripts/scripts.qbs",
    ]

    SubProject {
        filePath: "doc/doc.qbs"
        Properties {
            condition: parent.withDocumentation
        }
    }

    SubProject {
        filePath: "examples/examples.qbs"
        Properties {
            condition: parent.withExamples
        }
    }

    SubProject {
        filePath: "src/src.qbs"
        Properties {
            condition: parent.withCode
        }
    }

    SubProject {
        filePath: "tests/tests.qbs"
        Properties {
            condition: parent.withTests
        }
    }

    Product {
        name: "version"
        files: ["VERSION"]
    }

    Product {
        name: "qmake project files for qbs"
        files: ["**/*.pr[io]"]
    }
}

Add "continuous integration files" product

import qbs 1.0

Project {
    minimumQbsVersion: "1.6"
    qbsSearchPaths: ["qbs-resources"]
    property bool withCode: true
    property bool withDocumentation: true
    property bool withExamples: false
    property bool withTests: withCode
    property stringList autotestArguments: []
    property stringList autotestWrapper: []

    references: [
        "docker/docker.qbs",
        "share/share.qbs",
        "scripts/scripts.qbs",
    ]

    SubProject {
        filePath: "doc/doc.qbs"
        Properties {
            condition: parent.withDocumentation
        }
    }

    SubProject {
        filePath: "examples/examples.qbs"
        Properties {
            condition: parent.withExamples
        }
    }

    SubProject {
        filePath: "src/src.qbs"
        Properties {
            condition: parent.withCode
        }
    }

    SubProject {
        filePath: "tests/tests.qbs"
        Properties {
            condition: parent.withTests
        }
    }

    Product {
        name: "version"
        files: ["VERSION"]
    }

    Product {
        name: "qmake project files for qbs"
        files: ["**/*.pr[io]"]
    }

    Product {
        name: "continuous integration files"
        files: [
            ".travis.yml",
            ".clang-tidy",
            "docker-compose.yml",
        ]
    }
}


ListView {
	id: categoriesListProto;
	height: 70;
	anchors.top: parent.top;
	anchors.left: parent.left;
	anchors.right: parent.right;
	spacing: 10;
	orientation: 1;
	protocol: Protocol { enabled: true; }
	model: ChannelListModel {
		protocol: categoriesListProto.protocol;
		onCountChanged: { console.log("loaded " + this.count + " channel lists, using 0"); channelModel.setList(this.get(0)); }
	}
	delegate: Item {
		width: categoryName.paintedWidth + 20;
		height: parent.height;

		Text {
			id: categoryName;
			font.pixelSize: 40;
			anchors.centerIn: parent;
			text: model.asset ? model.asset.title : "";
			color: "#fff";
			opacity: parent.activeFocus ? 1.0 : 0.6;
		}
	}
}

Add top shadow for categories backgoround.

ListView {
	id: categoriesListProto;
	height: 70;
	anchors.top: parent.top;
	anchors.left: parent.left;
	anchors.right: parent.right;
	spacing: 10;
	orientation: 1;
	protocol: Protocol { enabled: true; }
	model: ChannelListModel {
		protocol: categoriesListProto.protocol;
		onCountChanged: { console.log("loaded " + this.count + " channel lists, using 0"); channelModel.setList(this.get(0)); }
	}
	delegate: Item {
		width: categoryName.paintedWidth + 20;
		height: parent.height;

		Text {
			id: categoryName;
			font.pixelSize: 40;
			anchors.centerIn: parent;
			text: model.asset ? model.asset.title : "";
			color: "#fff";
			opacity: parent.activeFocus ? 1.0 : 0.6;
		}
	}

	Rectangle {
		anchors.top: renderer.top;
		anchors.left: renderer.left;
		anchors.right: renderer.right;
		height: 140;

		gradient: Gradient {
			GradientStop { color: "#00000001"; position: 0; }
			GradientStop { color: "#00000001"; position: 0.3; }
			GradientStop { color: "#00000000"; position: 0.6; }
		}
	}
}


import QtQuick 2.3

FocusScope {
    id: root

    default property alias content: contentItem.data
    property alias titleBar: titleBarContainer.data

    signal activated
    signal currentItemChanged

    Component.onCompleted: {
        if (root.parent === null || root.parent.toString().substring(0, 9) !== "StackView")
            root.activated()
    }

    Connections {
        target: root.parent !== null && root.parent.toString().substring(0, 9) === "StackView" ? root.parent : root

        onCurrentItemChanged: {
            if (root.parent.currentItem === root)
                root.activated()
        }
    }

    FocusScope {
        id: titleBarContainer

        height: childrenRect.height
        width: parent.width
    }

    FocusScope {
        id: contentItem

        anchors {
            top: titleBarContainer.bottom
            bottom: parent.bottom
            left: parent.left
            right: parent.right
        }
    }
}

Add active property to ask if page is currently on top of stack

import QtQuick 2.3

FocusScope {
    id: root

    default property alias content: contentItem.data
    property alias titleBar: titleBarContainer.data
    property bool active: false

    signal activated
    signal currentItemChanged

    Component.onCompleted: {
        if (root.parent === null || root.parent.toString().substring(0, 9) !== "StackView") {
            root.activated()
            root.active = true
        }
    }

    Connections {
        target: root.parent !== null && root.parent.toString().substring(0, 9) === "StackView" ? root.parent : root

        onCurrentItemChanged: {
            if (root.parent.currentItem === root) {
                root.active = true
                root.activated()
            } else {
                root.active = false
            }
        }
    }

    FocusScope {
        id: titleBarContainer

        height: childrenRect.height
        width: parent.width
    }

    FocusScope {
        id: contentItem

        anchors {
            top: titleBarContainer.bottom
            bottom: parent.bottom
            left: parent.left
            right: parent.right
        }
    }
}


import qbs.base 1.0

DynamicLibrary {
    name: "styleplugin"
    destination: "lib/qtcreator/qtcomponents/plugin"

    Depends { name: "cpp" }
    Depends { name: "Qt"; submodules: ["core", "widgets", "quick1", "script"] }

    cpp.defines: project.additionalCppDefines

    files: [
        "qdeclarativefolderlistmodel.cpp",
        "qdeclarativefolderlistmodel.h",
        "qrangemodel.cpp",
        "qrangemodel.h",
        "qrangemodel_p.h",
        "qstyleitem.cpp",
        "qstyleitem.h",
        "qstyleplugin.cpp",
        "qstyleplugin.h",
        "qtmenu.cpp",
        "qtmenu.h",
        "qtmenubar.cpp",
        "qtmenubar.h",
        "qtmenuitem.cpp",
        "qtmenuitem.h",
        "qwheelarea.cpp",
        "qwheelarea.h"
    ]
}

Fix merge artifact in qbs file.

import qbs.base 1.0
import "../../../../qbs/defaults.js" as Defaults

DynamicLibrary {
    name: "styleplugin"
    destination: "lib/qtcreator/qtcomponents/plugin"

    Depends { name: "cpp" }
    Depends { name: "Qt"; submodules: ["core", "widgets", "quick1", "script"] }

    cpp.defines: Defaults.defines(qbs)

    files: [
        "qdeclarativefolderlistmodel.cpp",
        "qdeclarativefolderlistmodel.h",
        "qrangemodel.cpp",
        "qrangemodel.h",
        "qrangemodel_p.h",
        "qstyleitem.cpp",
        "qstyleitem.h",
        "qstyleplugin.cpp",
        "qstyleplugin.h",
        "qtmenu.cpp",
        "qtmenu.h",
        "qtmenubar.cpp",
        "qtmenubar.h",
        "qtmenuitem.cpp",
        "qtmenuitem.h",
        "qwheelarea.cpp",
        "qwheelarea.h"
    ]
}


Add test for shaping and rendering Sinhala text

import QtQuick 2.0

Item {
    width: 320
    height: 480

    Text {
        anchors.fill: parent
        wrapMode: Text.WrapAtWordBoundaryOrAnywhere
        font.family: "Arial"
        font.pixelSize: 20
        text: "සිංහළ අකුරු අබලං"
    }
}


import qbs
import qbs.Process
import qbs.TextFile

Project {
    property path qbsFilePath
    Product {
        type: {
            // Synchronous run, successful.
            var process = new Process();
            process.exec(qbsFilePath, ["help"], true);
            var output = new TextFile("output.txt", TextFile.WriteOnly);
            output.writeLine(process.exitCode());
            output.writeLine(process.readLine());
            process.close();

            // Asynchronous run, successful.
            process = new Process();
            output.writeLine(process.start(qbsFilePath, ["help"]));
            output.writeLine(process.waitForFinished());
            output.writeLine(process.exitCode());
            output.writeLine(process.readLine());
            process.close();

            // Asynchronous run, unsuccessful.
            process = new Process();
            output.writeLine(process.start("blubb", []));
            process.close();

            // TODO: Test all the other Process methods as well.

            output.close();
            return "My hovercraft is full of eels.";
        }
    }
}

Fix jsExtensionsProcess test on Windows.

import qbs
import qbs.FileInfo
import qbs.Process
import qbs.TextFile

Project {
    property path qbsFilePath
    Product {
        Depends { name: "Qt.core" }
        type: {
            // Synchronous run, successful.
            var process = new Process();
            process.setEnv("PATH", [qbs.getEnv("PATH"),
                Qt.core.binPath].join(qbs.pathListSeparator));
            process.exec(qbsFilePath, ["help"], true);
            var output = new TextFile("output.txt", TextFile.WriteOnly);
            output.writeLine(process.exitCode());
            output.writeLine(process.readLine());
            process.close();

            // Asynchronous run, successful.
            process = new Process();
            process.setEnv("PATH", [qbs.getEnv("PATH"),
                Qt.core.binPath].join(qbs.pathListSeparator));
            output.writeLine(process.start(qbsFilePath, ["help"]));
            output.writeLine(process.waitForFinished());
            output.writeLine(process.exitCode());
            output.writeLine(process.readLine());
            process.close();

            // Asynchronous run, unsuccessful.
            process = new Process();
            output.writeLine(process.start("blubb", []));
            process.close();

            // TODO: Test all the other Process methods as well.

            output.close();
            return "My hovercraft is full of eels.";
        }
    }
}


InputBase {
	property bool checked: false;
	height: 20;
	width: 173;
	type: "checkbox";

	constructor: {
		this.element.on("change", function() { this.checked = this.element.dom.checked }.bind(this))
	}
}

Set width same as height in ChekboxInput.

InputBase {
	property bool checked: false;
	height: 20;
	width: 20;
	type: "checkbox";

	constructor: {
		this.element.on("change", function() { this.checked = this.element.dom.checked }.bind(this))
	}
}


// -*- qml -*-

/*!
 * This file is part of CameraPlus.
 *
 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

import QtQuick 1.1

Item {
    property alias text: label.text
    property alias checked: switchComponent.checked
    width: parent.width
    height: switchComponent.height

    CameraLabel {
        id: label
        anchors.left: parent.left
        wrapMode: Text.Wrap
    }

    CameraSwitch {
        id: switchComponent
        anchors.right: parent.right
    }
}

Use harmattan CheckBox instead of our custom component

// -*- qml -*-

/*!
 * This file is part of CameraPlus.
 *
 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

import QtQuick 1.1
import com.nokia.meego 1.0

CheckBox {

}


import QtQuick 2.0

import Box2D 2.0

TouchPoint {

    property var touchedItem

    // when used to draw on the background:
    property var currentStroke: []
    property color color: "black"

    property MouseJoint joint: MouseJoint {
        bodyA: anchor
        dampingRatio: 1
        maxForce: 1
    }

    onXChanged: {

        if(touchedItem) {
            joint.target = Qt.point(x, y);
        }
        else {
            //only add stroke point in one dimension (Y) to avoid double drawing
            //drawingarea.addPoint(x, y, currentStroke);
        }
    }

    onYChanged: {
        if(touchedItem) {
            joint.target = Qt.point(x, y);
        }
        else {
            currentStroke.push(Qt.point(x,y));
            drawingarea.update();
        }
    }

    onPressedChanged: {

        if (pressed) {

            // find out whether we touched an item
            var obj = interactiveitems.childAt(x, y);
            if (obj.objectName === "interactive") {
                touchedItem = obj;
                joint.maxForce = obj.body.getMass() * 500;
                joint.target = Qt.point(x, y);
                joint.bodyB = obj.body;
            }
            else {
                currentStroke = [];
                color = drawingarea.fgColor;
            }

        }
        else { // released
            if(touchedItem) {
                joint.bodyB = null;
                touchedItem = null;
            }
            else {
                drawingarea.finishStroke(currentStroke);
                currentStroke = [];
            }
        }
    }
}

Make sure moving items and drawing do not overlap

import QtQuick 2.0

import Box2D 2.0

TouchPoint {

    property bool movingItem: false
    property bool drawing: false

    // when used to draw on the background:
    property var currentStroke: []
    property color color: "black"

    property MouseJoint joint: MouseJoint {
        bodyA: anchor
        dampingRatio: 1
        maxForce: 1
    }

    onXChanged: {

        if(movingItem) {
            joint.target = Qt.point(x, y);
        }

        // (only add stroke point in one dimension (Y) to avoid double drawing)
    }

    onYChanged: {
        if(movingItem) {
            joint.target = Qt.point(x, y);
        }

        if (drawing) {
            currentStroke.push(Qt.point(x,y));
            drawingarea.update();
        }
    }

    onPressedChanged: {

        if (pressed) {

            // find out whether we touched an item
            var obj = interactiveitems.childAt(x, y);
            if (obj.objectName === "interactive") {
                movingItem = true;
                joint.maxForce = obj.body.getMass() * 500;
                joint.target = Qt.point(x, y);
                joint.bodyB = obj.body;
            }
            else {
                currentStroke = [];
                color = drawingarea.fgColor;
                drawing = true;
            }

        }
        else { // released
            if(movingItem) {
                joint.bodyB = null;
                movingItem = false;
            }

            if(drawing) {
                drawing = false;
                drawingarea.finishStroke(currentStroke);
                currentStroke = [];
            }
        }
    }
}


Object {
	property bool playing;
	property enum type { Sine, Square, Sawtooth, Triangle };
	property int frequency;
	property int detune;

	Timer {
		id: timeOutTimer;

		start(timeOut): {
			this.interval = timeOut
			this.restart()
		}

		onTriggered: { this.parent.pause() }
	}

	function _update(name, value) {
		switch (name) {
			case 'detune': this._oscillator.frequency.value = value; break
			case 'frequency': this._oscillator.detune.value = value; break
			case 'type':
				switch(value) {
				case this.Sine:		oscillator.type = 'sine'; break
				case this.Square:	oscillator.type = 'square'; break
				case this.Sawtooth:	oscillator.type = 'sawtooth'; break
				case this.Triangle:	oscillator.type = 'triangle'; break
				}
				break
		}

		_globals.core.Item.prototype._update.apply(this, arguments);
	}

	play: {
		if (this.playing)
			return
		this._oscillator.start()
		this.playing = true
	}

	pause: {
		if (!this.playing)
			return
		this._oscillator.stop()
		this.playing = false
	}

	playPause: { this.playing ? this.pause() : this.play() }

	playWithTimeout(ms): {
		this.play()
		timeOutTimer.start(ms)
	}

	onPlayingChanged: {
		if (value)
			return
		delete this._oscillator
		this._oscillator = this._audioCtx.createOscillator()
		this._oscillator.connect(this._audioCtx.destination)
		this.reset()
	}

	constructor: {
		if (window.AudioContext || window.webkitAudioContext) {
			this._audioCtx = new (window.AudioContext || window.webkitAudioContext)();
			this._oscillator = this._audioCtx.createOscillator()
			this._oscillator.connect(this._audioCtx.destination)
			this.reset()
		} else {
			log("Web Audio API not supported")
			return
		}
	}

	reset: {
		var oscillator = this._oscillator
		oscillator.frequency.value = this.frequency
		oscillator.detune.value = this.detune
		switch(this.type) {
		case this.Sine:		oscillator.type = 'sine'
		case this.Square:	oscillator.type = 'square'
		case this.Sawtooth:	oscillator.type = 'sawtooth'
		case this.Triangle:	oscillator.type = 'triangle'
		}
	}
}


import qbs 1.0
import qbs.FileInfo

Module {
    property string buildVariant: "debug"
    property bool enableDebugCode: buildVariant == "debug"
    property bool debugInformation: (buildVariant == "debug")
    property string optimization: (buildVariant == "debug" ? "none" : "fast")
    property stringList hostOS: getHostOS()
    property stringList targetOS: hostOS
    property string pathListSeparator: hostOS.contains("windows") ? ";" : ":"
    property string pathSeparator: hostOS.contains("windows") ? "\\" : "/"
    property string profile
    property stringList toolchain
    property string architecture

    property string endianness
    PropertyOptions {
        name: "endianness"
        allowedValues: ["big", "little", "mixed"]
        description: "endianness of the target platform"
    }

    property bool install: false
    property string installDir
    property string installPrefix: ""
    property path sysroot

    PropertyOptions {
        name: "buildVariant"
        allowedValues: ['debug', 'release']
        description: "name of the build variant"
    }

    PropertyOptions {
        name: "optimization"
        allowedValues: ['none', 'fast', 'small']
        description: "optimization level"
    }
}

Enforce canonical architecture names in qbs.architecture.

import qbs 1.0
import qbs.FileInfo

Module {
    property string buildVariant: "debug"
    property bool enableDebugCode: buildVariant == "debug"
    property bool debugInformation: (buildVariant == "debug")
    property string optimization: (buildVariant == "debug" ? "none" : "fast")
    property stringList hostOS: getHostOS()
    property stringList targetOS: hostOS
    property string pathListSeparator: hostOS.contains("windows") ? ";" : ":"
    property string pathSeparator: hostOS.contains("windows") ? "\\" : "/"
    property string profile
    property stringList toolchain
    property string architecture

    property string endianness
    PropertyOptions {
        name: "endianness"
        allowedValues: ["big", "little", "mixed"]
        description: "endianness of the target platform"
    }

    property bool install: false
    property string installDir
    property string installPrefix: ""
    property path sysroot

    PropertyOptions {
        name: "buildVariant"
        allowedValues: ['debug', 'release']
        description: "name of the build variant"
    }

    PropertyOptions {
        name: "optimization"
        allowedValues: ['none', 'fast', 'small']
        description: "optimization level"
    }

    validate: {
        var architectureSynonyms = {
            "x86": ["i386", "i486", "i586", "i686", "ia32", "ia-32", "x86_32", "x86-32", "intel32"],
            "x86_64": ["x86-64", "x64", "amd64", "ia32e", "em64t", "intel64"],
            "ia64": ["ia-64", "itanium"]
        };

        for (var arch in architectureSynonyms) {
            if (architectureSynonyms[arch].contains(architecture.toLowerCase())) {
                throw "qbs.architecture '" + architecture + "' is invalid. " +
                      "You must use the canonical name '" + arch + "'";
            }
        }
    }
}


import Qt 4.6
import Qt.widgets 4.6

Item {
    id: resizable
    width:300
    height:300

    GraphicsObjectContainer {
        anchors.fill: parent
        synchronizedResizing: true

        QGraphicsWidget {

            layout: QGraphicsLinearLayout {
                spacing: 0
                LayoutItem {
                    objectName: "left"
                    minimumSize: "100x100"
                    maximumSize: "300x300"
                    preferredSize: "100x100"
                    Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
                }
                LayoutItem {
                    objectName: "right"
                    minimumSize: "100x100"
                    maximumSize: "400x400"
                    preferredSize: "200x200"
                    Rectangle { objectName: "greenRect"; color: "green"; anchors.fill: parent }
                }
            }
        }
    }
}

Fix test after deletion of GraphicsObjectContainer.

import Qt 4.6
import Qt.widgets 4.6

Item {
    id: resizable
    width:300
    height:300
    QGraphicsWidget {
        x : resizable.x
        y : resizable.y
        width : resizable.width
        height : resizable.height
        layout: QGraphicsLinearLayout {
            spacing: 0
            LayoutItem {
                objectName: "left"
                minimumSize: "100x100"
                maximumSize: "300x300"
                preferredSize: "100x100"
                Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
            }
            LayoutItem {
                objectName: "right"
                minimumSize: "100x100"
                maximumSize: "400x400"
                preferredSize: "200x200"
                Rectangle { objectName: "greenRect"; color: "green"; anchors.fill: parent }
            }
        }
    }
}


/// component for loading custom component dinamycly via its URL
Item {
	signal loaded;				///< when requested component it loaded event signal
	property string source;		///< component's URL
	property Object item;		///< item for storing requested component

	///@private
	function discardItem() {
		var item = this.item
		if (item) {
			item.discard()
			item = null
		}
	}

	///@private
	function discard() {
		this.discardItem()
		_globals.core.Item.prototype.discard.call(this)
	}

	///@internal
	onSourceChanged: {
		this.discardItem()
		this._load()
	}

	///@internal
	function _load() {
		var source = this.source
		if (!source)
			return

		log('loading ' + source + '...')
		var path = source.split('.')
		var ctor = _globals
		while(path.length) {
			var ns = path.shift()
			ctor = ctor[ns]
			if (ctor === undefined)
				throw new Error('unknown component used: ' + source)
		}
		var item = new ctor(this)
		var closure = {}
		item.__create(closure)
		item.__setup(closure)
		this.item = item
		this.loaded()
	}

	///@internal
	onCompleted: {
		this._load()
	}
}

Call 'completed' signal for loaded item.

/// component for loading custom component dinamycly via its URL
Item {
	signal loaded;				///< when requested component it loaded event signal
	property string source;		///< component's URL
	property Object item;		///< item for storing requested component

	///@private
	function discardItem() {
		var item = this.item
		if (item) {
			item.discard()
			item = null
		}
	}

	///@private
	function discard() {
		this.discardItem()
		_globals.core.Item.prototype.discard.call(this)
	}

	///@internal
	onSourceChanged: {
		this.discardItem()
		this._load()
	}

	///@internal
	function _load() {
		var source = this.source
		if (!source)
			return

		log('loading ' + source + '...')
		var path = source.split('.')
		var ctor = _globals
		while(path.length) {
			var ns = path.shift()
			ctor = ctor[ns]
			if (ctor === undefined)
				throw new Error('unknown component used: ' + source)
		}
		var item = new ctor(this)
		var closure = {}
		item.__create(closure)
		item.__setup(closure)
		this.item = item
		this._context._complete()
		this.loaded()
	}

	///@internal
	onCompleted: {
		this._load()
	}
}


import qbs

CppApplication {
    Depends { name: "themodule" }
    files: ["main.cpp"]
    Group {
        cpp.defines: ["REQUIRED_FOR_FILE1", "BREAKS_FILE2"]

        // This group has no files, and that's okay.

        Group {
            files: ["other.cpp", "other.h"]
            Group {
                cpp.defines: outer.concat(["ALSO_REQUIRED_FOR_FILE1"])
                files: ["file1.cpp", "file1.h"]
            }
            Group {
                cpp.defines: ["REQUIRED_FOR_FILE2"]
                files: ["file2.cpp", "file2.h"]
            }
            Group {
                name: "disabled"
                condition: false
                Group {
                    name: "indirectly disabled"
                    condition: true
                    files: ["main2.cpp"]
                }
            }
        }
    }
}

Fix nestedGroups() autotest on macOS

import qbs

CppApplication {
    consoleApplication: true
    Depends { name: "themodule" }
    files: ["main.cpp"]
    Group {
        cpp.defines: ["REQUIRED_FOR_FILE1", "BREAKS_FILE2"]

        // This group has no files, and that's okay.

        Group {
            files: ["other.cpp", "other.h"]
            Group {
                cpp.defines: outer.concat(["ALSO_REQUIRED_FOR_FILE1"])
                files: ["file1.cpp", "file1.h"]
            }
            Group {
                cpp.defines: ["REQUIRED_FOR_FILE2"]
                files: ["file2.cpp", "file2.h"]
            }
            Group {
                name: "disabled"
                condition: false
                Group {
                    name: "indirectly disabled"
                    condition: true
                    files: ["main2.cpp"]
                }
            }
        }
    }
}


/*
* Copyright © 2015-2016 Oleksii Aliakin. All rights reserved.
* Author: Oleksii Aliakin (alex@nls.la)
* Author: Andrii Shelest
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import qbs
import qbs.FileInfo

Project {
    name: "fgap_project"
    minimumQbsVersion: "1.5"

    property path appSourceRoot: sourceDirectory

    qbsSearchPaths: ["qbs", "contrib/Qt-Qbs-Application/qbs"]

    references: [
        "src/FlightController.qbs",
        "contrib/submodules.qbs",
    ]
}

Use qbs vesrion = 1.4

/*
* Copyright © 2015-2016 Oleksii Aliakin. All rights reserved.
* Author: Oleksii Aliakin (alex@nls.la)
* Author: Andrii Shelest
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import qbs
import qbs.FileInfo

Project {
    name: "fgap_project"
    minimumQbsVersion: "1.4"

    property path appSourceRoot: sourceDirectory

    qbsSearchPaths: ["qbs", "contrib/Qt-Qbs-Application/qbs"]

    references: [
        "src/FlightController.qbs",
        "contrib/submodules.qbs",
    ]
}


import qbs.base 1.0

Product {
    name: "SharedContent"

    Group {
        name: "Unconditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path
        prefix: "qtcreator/"
        files: [
            "designer",
            "dumper",
            "generic-highlighter",
            "glsl",
            "qml",
            "qmldesigner",
            "qmlicons",
            "qml-type-descriptions",
            "schemes",
            "snippets",
            "styles",
            "templates",
            "welcomescreen"
        ]
    }

    Group {
        name: "Conditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path + "/externaltools"
        prefix: "../src/share/qtcreator/externaltools/"
        files: {
            var list = [
                "lrelease.xml",
                "lupdate.xml",
                "qmlviewer.xml",
                "sort.xml",
            ]
            if (qbs.targetOS.contains("windows"))
                list.push("notepad_win.xml");
            else if (qbs.targetOS.contains("osx"))
                list.push("vi_mac.xml");
            else
                list.push("vi.xml");
            return list;
        }
    }
}

Add qmlscene to qbs build

import qbs.base 1.0

Product {
    name: "SharedContent"

    Group {
        name: "Unconditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path
        prefix: "qtcreator/"
        files: [
            "designer",
            "dumper",
            "generic-highlighter",
            "glsl",
            "qml",
            "qmldesigner",
            "qmlicons",
            "qml-type-descriptions",
            "schemes",
            "snippets",
            "styles",
            "templates",
            "welcomescreen"
        ]
    }

    Group {
        name: "Conditional"
        qbs.install: true
        qbs.installDir: project.ide_data_path + "/externaltools"
        prefix: "../src/share/qtcreator/externaltools/"
        files: {
            var list = [
                "lrelease.xml",
                "lupdate.xml",
                "qmlscene.xml",
                "qmlviewer.xml",
                "sort.xml",
            ]
            if (qbs.targetOS.contains("windows"))
                list.push("notepad_win.xml");
            else if (qbs.targetOS.contains("osx"))
                list.push("vi_mac.xml");
            else
                list.push("vi.xml");
            return list;
        }
    }
}


import Test 1.0
import Qt 4.6

MyTypeObject {
    property var object

    Script { source: "deletedObject.js" }

    object: MyTypeObject {}
    Component.onCompleted: startup()
    onRunScript: afterDelete()
}

Remove usage of Script where not actually testing the obsolete construct.

import Test 1.0
import Qt 4.6
import "deletedObject.js" as JS

MyTypeObject {
    property var object

    object: MyTypeObject {}
    Component.onCompleted: JS.startup()
    onRunScript: JS.afterDelete()
}


import qbs

Project {
    QtApplication {
        consoleApplication: true

        Depends { name: "thePlugin" }

        cpp.cxxLanguageVersion: "c++11"
        cpp.rpaths: [cpp.rpathOrigin]

        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }

        files: ["app.cpp"]
    }

    Library {
        type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary"
        name: "thePlugin"

        Depends { name: "cpp" }
        Depends { name: "Qt.core" }

        Properties {
            condition: qbs.targetOS.contains("darwin")
            bundle.isBundle: false
        }
        cpp.defines: [Qt.core.staticBuild ? "QT_STATICPLUGIN" : "QT_PLUGIN"]
        cpp.cxxLanguageVersion: "c++11"
        cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined
        cpp.includePaths: ["."]
        Qt.core.pluginMetaData: ["theKey=theValue"]

        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }

        files: ["theplugin.cpp"]

        Group {
            files: ["metadata.json"]
            fileTags: ["qt_plugin_metadata"]
        }
    }
}

Fix pluginMetaData autotest on Windows

import qbs

Project {
    QtApplication {
        consoleApplication: true

        Depends { name: "thePlugin" }

        cpp.cxxLanguageVersion: "c++11"

        Properties {
            condition: qbs.targetOS.contains("unix")
            cpp.rpaths: [cpp.rpathOrigin]
        }

        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }

        files: ["app.cpp"]
    }

    Library {
        type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary"
        name: "thePlugin"

        Depends { name: "cpp" }
        Depends { name: "Qt.core" }

        Properties {
            condition: qbs.targetOS.contains("darwin")
            bundle.isBundle: false
        }
        cpp.defines: [Qt.core.staticBuild ? "QT_STATICPLUGIN" : "QT_PLUGIN"]
        cpp.cxxLanguageVersion: "c++11"
        cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined
        cpp.includePaths: ["."]
        Qt.core.pluginMetaData: ["theKey=theValue"]

        Group {
            fileTagsFilter: product.type
            qbs.install: true
        }

        files: ["theplugin.cpp"]

        Group {
            files: ["metadata.json"]
            fileTags: ["qt_plugin_metadata"]
        }
    }
}


import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.0 as UM

UM.Dialog {
    id: base

    //: Add Printer dialog title
    title: qsTr("About Cura");

    Label {
        text: "Cura";
    }

    rightButtons: Button {
        text: "Close";

        onClicked: base.visible = false;
    }
}

Improve the About dialog a bit

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1

import UM 1.0 as UM

UM.Dialog {
    id: base

    //: About dialog title
    title: qsTr("About Cura");

    ColumnLayout {
        anchors.fill: parent;

        Item {
            Layout.fillWidth: true;
            Layout.fillHeight: true;
        }

        Image {
            Layout.alignment: Qt.AlignHCenter;
            Layout.preferredWidth: parent.width * 0.75;
            Layout.preferredHeight: width * (1/4.25);

            source: UM.Theme.images.logo;

            sourceSize.width: width;
            sourceSize.height: height;
        }

        Label {
            Layout.alignment: Qt.AlignHCenter;

            text: "Cura 15.06";
            font: UM.Theme.fonts.large;
        }

        Label {
            text: qsTr("End-to-end solution for fused filament 3D printing.")
        }

        Label {
            text: qsTr("Cura has been developed by Ultimaker B.V. in cooperation with the community.")
        }

        Item {
            Layout.fillWidth: true;
            Layout.fillHeight: true;
        }
    }

    rightButtons: Button {
        //: Close about dialog button
        text: qsTr("Close");

        onClicked: base.visible = false;
    }
}


import QtQuick 2.1
import QtQuick.Controls 1.2

Item {
  id: root
  signal inputValueChanged(real value)
  property real value
  property color color
  property real minValue: 0
  property real maxValue: 10

  TextInput {
    x: 10
    id: weightInput
    maximumLength: 6
    width: 50
    validator: DoubleValidator {
      bottom: root.minValue
      top: root.maxValue
    }
    inputMethodHints: Qt.ImhFormattedNumbersOnly
    horizontalAlignment: Qt.AlignRight
    text: root.value
    color: root.color
    onTextChanged: {
      weightSlider.value = text;
      root.inputValueChanged(text);
    }
  }
  Slider {
    id: weightSlider
    width: 180
    x: 66
    minimumValue: root.minValue
    maximumValue: root.maxValue
    value: root.value
    onValueChanged: {
      weightInput.text = value;
      root.inputValueChanged(value);
    }
  }
}

Add default text color black and reduce slider width.

import QtQuick 2.1
import QtQuick.Controls 1.2

Item {
  id: root
  signal inputValueChanged(real value)
  property real value
  property color color: "black"
  property real minValue: 0
  property real maxValue: 10

  TextInput {
    x: 10
    id: weightInput
    maximumLength: 6
    width: 50
    validator: DoubleValidator {
      bottom: root.minValue
      top: root.maxValue
    }
    inputMethodHints: Qt.ImhFormattedNumbersOnly
    horizontalAlignment: Qt.AlignRight
    text: root.value
    color: root.color
    onTextChanged: {
      weightSlider.value = text;
      root.inputValueChanged(text);
    }
  }
  Slider {
    id: weightSlider
    width: 150
    x: 66
    minimumValue: root.minValue
    maximumValue: root.maxValue
    value: root.value
    onValueChanged: {
      weightInput.text = value;
      root.inputValueChanged(value);
    }
  }
}


/// this mixin provides mouse press events handling
Object {
	property bool enabled: true;	///< enable/disable mixin
	property int mouseX;
	property int mouseY;
	signal mouseMove;

	///@private
	constructor: {
		this.element = this.parent.element;
		this._bindMove(this.enabled)
	}

	/// @private
	function _updatePosition(event) {
		var parent = this.parent
		var x = event.offsetX
		var y = event.offsetY
		if (x >= 0 && y >= 0 && x < parent.width && y < parent.height) {
			this.mouseX = x
			this.mouseY = y
			this.mouseMove(x, y)
			return true
		}
		else
			return false
	}

	/// @private
	function _bindMove(value) {
		if (value && !this._mmmPressBinder) {
			this._mmmPressBinder = new _globals.core.EventBinder(this.element)
			this._mmmPressBinder.on('mousemove', function(event) {
				if (!this._updatePosition(event))
					event.preventDefault()
			}.bind(this))
		}
		if (this._mmmPressBinder)
			this._mmmPressBinder.enable(value)
	}

	onEnabledChanged: {
		this._bindMove(value)
	}
}

Use readable mane for signal binder

/// this mixin provides mouse press events handling
Object {
	property bool enabled: true;	///< enable/disable mixin
	property int mouseX;
	property int mouseY;
	signal mouseMove;

	///@private
	constructor: {
		this.element = this.parent.element;
		this._bindMove(this.enabled)
	}

	/// @private
	function _updatePosition(event) {
		var parent = this.parent
		var x = event.offsetX
		var y = event.offsetY
		if (x >= 0 && y >= 0 && x < parent.width && y < parent.height) {
			this.mouseX = x
			this.mouseY = y
			this.mouseMove(x, y)
			return true
		}
		else
			return false
	}

	/// @private
	function _bindMove(value) {
		if (value && !this._mouseMoveBinder) {
			this._mouseMoveBinder = new _globals.core.EventBinder(this.element)
			this._mouseMoveBinder.on('mousemove', function(event) {
				if (!this._updatePosition(event))
					event.preventDefault()
			}.bind(this))
		}
		if (this._mouseMoveBinder)
			this._mouseMoveBinder.enable(value)
	}

	onEnabledChanged: {
		this._bindMove(value)
	}
}


import qbs.base 1.0
import "../QtcLibrary.qbs" as QtcLibrary

QtcLibrary {
    name: "QmlDebug"

    cpp.defines: base.concat("QMLDEBUG_LIB")

    Depends { name: "cpp" }
    Depends { name: "Qt"; submodules: ["gui", "network"] }

    files: [
        "baseenginedebugclient.cpp",
        "baseenginedebugclient.h",
        "basetoolsclient.cpp",
        "basetoolsclient.h",
        "declarativeenginedebugclient.cpp",
        "declarativeenginedebugclient.h",
        "declarativeenginedebugclientv2.h",
        "declarativetoolsclient.cpp",
        "declarativetoolsclient.h",
        "qdebugmessageclient.cpp",
        "qdebugmessageclient.h",
        "qmldebug_global.h",
        "qmldebugclient.cpp",
        "qmldebugclient.h",
        "qmldebugconstants.h",
        "qmlenginedebugclient.h",
        "qmloutputparser.cpp",
        "qmloutputparser.h",
        "qmlprofilereventlocation.h",
        "qmlprofilereventtypes.h",
        "qmlprofilertraceclient.cpp",
        "qmlprofilertraceclient.h",
        "qmltoolsclient.cpp",
        "qmltoolsclient.h",
        "qpacketprotocol.cpp",
        "qpacketprotocol.h",
        "qv8profilerclient.cpp",
        "qv8profilerclient.h",
    ]
}

Remove redundant dependency from qbs file.

import qbs.base 1.0
import "../QtcLibrary.qbs" as QtcLibrary

QtcLibrary {
    name: "QmlDebug"

    cpp.defines: base.concat("QMLDEBUG_LIB")

    Depends { name: "Qt"; submodules: ["gui", "network"] }

    files: [
        "baseenginedebugclient.cpp",
        "baseenginedebugclient.h",
        "basetoolsclient.cpp",
        "basetoolsclient.h",
        "declarativeenginedebugclient.cpp",
        "declarativeenginedebugclient.h",
        "declarativeenginedebugclientv2.h",
        "declarativetoolsclient.cpp",
        "declarativetoolsclient.h",
        "qdebugmessageclient.cpp",
        "qdebugmessageclient.h",
        "qmldebug_global.h",
        "qmldebugclient.cpp",
        "qmldebugclient.h",
        "qmldebugconstants.h",
        "qmlenginedebugclient.h",
        "qmloutputparser.cpp",
        "qmloutputparser.h",
        "qmlprofilereventlocation.h",
        "qmlprofilereventtypes.h",
        "qmlprofilertraceclient.cpp",
        "qmlprofilertraceclient.h",
        "qmltoolsclient.cpp",
        "qmltoolsclient.h",
        "qpacketprotocol.cpp",
        "qpacketprotocol.h",
        "qv8profilerclient.cpp",
        "qv8profilerclient.h",
    ]
}


import QtQuick 2.1
import QtQuick.Controls 1.0
import MyModules 1.0

ApplicationWindow {
    title: "Hello World"
    width: 600
    height: 300

    FileOpenDialog {
        id: openFile
        title: "Open file"
        nameFilters: ["Images (*.png, *.jpg, *.jpeg)", "Documents (*.doc, *.docx)", "All files (*)"]

        onAccepted: outputOpenFile.text = "File selected: " + openFile.fileUrl
        onRejected: outputOpenFile.text = "File selected: –"
    }

    FileSaveDialog {
        id: saveFile
        title: "Save file"
        filename: "download.png"
        nameFilters: ["Images (*.png)", "All files (*)"]

        onAccepted: outputSaveFile.text = "File selected: " + saveFile.fileUrl
        onRejected: outputSaveFile.text = "File selected: –"
    }

    Column {
        spacing: 20

        Button {
            text: "Open File"
            onClicked: { openFile.open(); }
        }
        Text { id: outputOpenFile }

        Button {
            text: "Save File"
            onClicked: { saveFile.open(); }
        }
        Text { id: outputSaveFile }
    }
}

Fix commas in sample qml file - (*.jpg, *.png) does not work. (*.jpg *.png) does.

import QtQuick 2.1
import QtQuick.Controls 1.0
import MyModules 1.0

ApplicationWindow {
    title: "Hello World"
    width: 600
    height: 300

    FileOpenDialog {
        id: openFile
        title: "Open file"
        nameFilters: ["Images (*.png *.jpg *.jpeg)", "Documents (*.doc *.docx)", "All files (*)"]

        onAccepted: outputOpenFile.text = "File selected: " + openFile.fileUrl
        onRejected: outputOpenFile.text = "File selected: –"
    }

    FileSaveDialog {
        id: saveFile
        title: "Save file"
        filename: "download.png"
        nameFilters: ["Images (*.png)", "All files (*)"]

        onAccepted: outputSaveFile.text = "File selected: " + saveFile.fileUrl
        onRejected: outputSaveFile.text = "File selected: –"
    }

    Column {
        spacing: 20

        Button {
            text: "Open File"
            onClicked: { openFile.open(); }
        }
        Text { id: outputOpenFile }

        Button {
            text: "Save File"
            onClicked: { saveFile.open(); }
        }
        Text { id: outputSaveFile }
    }
}


import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1

import UM 1.0 as UM

Rectangle {
    id: base;

    property Action addMachineAction;
    property Action configureMachinesAction;

    MouseArea {
        anchors.fill: parent
        acceptedButtons: Qt.AllButtons;

        onWheel: {
            wheel.accepted = true;
        }
    }

    ColumnLayout {
        anchors.fill: parent;
        anchors.topMargin: UM.Theme.sizes.default_margin.height;
        anchors.bottomMargin: UM.Theme.sizes.default_margin.height;

        spacing: UM.Theme.sizes.default_margin.height;

        SidebarHeader {
            id: header;

            Layout.fillWidth: true;

            addMachineAction: base.addMachineAction;
            configureMachinesAction: base.configureMachinesAction;
        }

        Loader {
            id: sidebarContents;

            Layout.fillWidth: true;
            Layout.fillHeight: true;

            source: header.currentModeFile;
        }

        OutputGCodeButton {
            Layout.preferredWidth: base.width - UM.Theme.sizes.default_margin.width * 2;
            Layout.preferredHeight: UM.Theme.sizes.section.height;
            Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter;
        }
    }
}

Use AngledCornerRectangle for the sidebar background

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1

import UM 1.0 as UM

UM.AngledCornerRectangle {
    id: base;

    property Action addMachineAction;
    property Action configureMachinesAction;

    cornerSize: UM.Theme.sizes.default_margin.width;

    MouseArea {
        anchors.fill: parent
        acceptedButtons: Qt.AllButtons;

        onWheel: {
            wheel.accepted = true;
        }
    }

    ColumnLayout {
        anchors.fill: parent;
        anchors.topMargin: UM.Theme.sizes.default_margin.height;
        anchors.bottomMargin: UM.Theme.sizes.default_margin.height;

        spacing: UM.Theme.sizes.default_margin.height;

        SidebarHeader {
            id: header;

            Layout.fillWidth: true;

            addMachineAction: base.addMachineAction;
            configureMachinesAction: base.configureMachinesAction;
        }

        Loader {
            id: sidebarContents;

            Layout.fillWidth: true;
            Layout.fillHeight: true;

            source: header.currentModeFile;
        }

        OutputGCodeButton {
            Layout.preferredWidth: base.width - UM.Theme.sizes.default_margin.width * 2;
            Layout.preferredHeight: UM.Theme.sizes.button.height;
            Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter;
        }
    }
}