Skip to content

Commit

Permalink
Add progress-bar support
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Mar 28, 2018
1 parent eabe685 commit 3cbeb52
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 47 deletions.
13 changes: 13 additions & 0 deletions README.adoc
Expand Up @@ -161,6 +161,14 @@ $ ./gradlew :sampler:run

*NOTE:* all elements inside the vertical button group must have the same width.

=== Progress Bars

* progress-bar-primary
* progress-bar-success
* progress-bar-info
* progress-bar-warning
* progress-bar-danger

=== Miscellaneous

* badge
Expand All @@ -179,6 +187,11 @@ image::images/splitmenu-buttons.png[]

== Changelog

.0.2.3

* Added `progress-bar` variants
* Tweaked menu items and menus

.0.2.2

* Add `Automatic-Module-Name` to JAR manifest
Expand Down
Expand Up @@ -17,7 +17,7 @@
}

.menu-item:focused {
-fx-background-color: #f5f5f5;
-fx-background-color: $progress-bg;
}

.menu-item:focused > * {
Expand Down
Expand Up @@ -25,7 +25,7 @@
//@import "mixins/list-group";
//@import "mixins/nav-divider";
//@import "mixins/forms";
//@import "mixins/progress-bar";
@import "mixins/progress-bar";
//@import "mixins/table-row";

// Skins
Expand Down
Expand Up @@ -7,69 +7,73 @@
// -------------------------

// WebKit
@-webkit-keyframes progress-bar-stripes {
from { background-position: 40px 0; }
to { background-position: 0 0; }
}

// Spec and IE10+
@keyframes progress-bar-stripes {
from { background-position: 40px 0; }
to { background-position: 0 0; }
}
// @-webkit-keyframes progress-bar-stripes {
// from { background-position: 40px 0; }
// to { background-position: 0 0; }
// }
//
// // Spec and IE10+
// @keyframes progress-bar-stripes {
// from { background-position: 40px 0; }
// to { background-position: 0 0; }
// }


// Bar itself
// -------------------------

// Outer container
.progress {
overflow: hidden;
height: $line-height-computed;
margin-bottom: $line-height-computed;
background-color: $progress-bg;
border-radius: $progress-border-radius;
@include box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
}
// .progress {
// overflow: hidden;
// height: $line-height-computed;
// margin-bottom: $line-height-computed;
// background-color: $progress-bg;
// border-radius: $progress-border-radius;
// @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
// }

// Bar of progress
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: $font-size-small;
line-height: $line-height-computed;
color: $progress-bar-color;
text-align: center;
background-color: $progress-bar-bg;
@include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
@include transition(width .6s ease);
}
// .progress-bar {
// float: left;
// width: 0%;
// height: 100%;
// font-size: $font-size-small;
// line-height: $line-height-computed;
// color: $progress-bar-color;
// text-align: center;
// background-color: $progress-bar-bg;
// @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
// @include transition(width .6s ease);
// }

// Striped bars
//
// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the
// `.progress-bar-striped` class, which you just add to an existing
// `.progress-bar`.
.progress-striped .progress-bar,
.progress-bar-striped {
@include gradient-striped;
background-size: 40px 40px;
}
// .progress-striped .progress-bar,
// .progress-bar-striped {
// @include gradient-striped;
// background-size: 40px 40px;
// }

// Call animation for the active one
//
// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the
// `.progress-bar.active` approach.
.progress.active .progress-bar,
.progress-bar.active {
@include animation(progress-bar-stripes 2s linear infinite);
}
// .progress.active .progress-bar,
// .progress-bar.active {
// @include animation(progress-bar-stripes 2s linear infinite);
// }


// Variations
// -------------------------

.progress-bar-primary {
@include progress-bar-variant($progress-bar-bg);
}

.progress-bar-success {
@include progress-bar-variant($progress-bar-success-bg);
}
Expand Down
@@ -1,10 +1,19 @@
// Progress bars

@mixin progress-bar-variant($color) {
background-color: $color;
& > .bar {
-fx-background-insets: 0;
-fx-background-color: $color;
-fx-progress-color: $color;
-fx-text-fill: $progress-bar-color;
-fx-text-alignment: center;
@include box-shadow(0, 0, -1px, 0, rgba(0, 0, 0, .15));
}

// Deprecated parent class requirement as of v3.2.0
.progress-striped & {
@include gradient-striped;
}
& > .track {
-fx-pref-height: 10;
-fx-background-radius: $progress-border-radius;
-fx-effect: innershadow(gaussian, $gray-lighter, 4, 0, 0, 1);
-fx-background-color: $progress-bg;
}
}
Expand Up @@ -42,7 +42,7 @@
//@import "bootstrap/jumbotron";
//@import "bootstrap/thumbnails";
@import "bootstrap/alerts";
//@import "bootstrap/progress-bars";
@import "bootstrap/progress-bars";
//@import "bootstrap/media";
//@import "bootstrap/list-group";
@import "bootstrap/panels";
Expand Down
Expand Up @@ -48,6 +48,7 @@ public void start(Stage primaryStage) throws Exception {
tabPane.getTabs().add(new DemoTab("Alerts", "alerts.fxml"));
tabPane.getTabs().add(new DemoTab("Panels", "panels.fxml"));
tabPane.getTabs().add(new DemoTab("Headings", "text.fxml"));
tabPane.getTabs().add(new DemoTab("Progress Bars", "progressbars.fxml"));
tabPane.getTabs().add(new DemoTab("Text ", "text2.fxml"));
tabPane.getTabs().add(new DemoTab("Paragraph ", "paragraph.fxml"));
tabPane.getTabs().add(new DemoTab("Button Groups ", "button_groups.fxml"));
Expand Down
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015-2018 Andres Almiray
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.layout.GridPane?>
<GridPane hgap="10" vgap="10" styleClass="page">
<padding>
<Insets top="20" left="20" bottom="20" right="20"/>
</padding>

<Label GridPane.columnIndex="0" GridPane.rowIndex="0" text="progress-bar-primary"/>
<ProgressBar GridPane.columnIndex="1" GridPane.rowIndex="0" GridPane.hgrow="ALWAYS"
styleClass="progress-bar-primary"/>

<Label GridPane.columnIndex="0" GridPane.rowIndex="1" text="progress-bar-success"/>
<ProgressBar GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.hgrow="ALWAYS"
styleClass="progress-bar-success"/>

<Label GridPane.columnIndex="0" GridPane.rowIndex="2" text="progress-bar-info"/>
<ProgressBar GridPane.columnIndex="1" GridPane.rowIndex="2" GridPane.hgrow="ALWAYS"
styleClass="progress-bar-info"/>

<Label GridPane.columnIndex="0" GridPane.rowIndex="3" text="progress-bar-warning"/>
<ProgressBar GridPane.columnIndex="1" GridPane.rowIndex="3" GridPane.hgrow="ALWAYS"
styleClass="progress-bar-warning"/>

<Label GridPane.columnIndex="0" GridPane.rowIndex="4" text="progress-bar-danger"/>
<ProgressBar GridPane.columnIndex="1" GridPane.rowIndex="4" GridPane.hgrow="ALWAYS"
styleClass="progress-bar-danger"/>
</GridPane>

0 comments on commit 3cbeb52

Please sign in to comment.