From 6dcf0e95163701953cd816caecd68295516785f0 Mon Sep 17 00:00:00 2001 From: ujiro99 Date: Mon, 30 Jan 2017 00:27:19 +0900 Subject: [PATCH] Enable change font size --- src/coffee/controllers/mainCtrl.coffee | 2 ++ src/coffee/services/option.coffee | 1 + src/jade/_options.jade | 8 ++++++++ src/jade/index.jade | 2 +- src/stylus/components/switch.styl | 2 +- src/stylus/main.styl | 7 +++---- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/coffee/controllers/mainCtrl.coffee b/src/coffee/controllers/mainCtrl.coffee index af1b06d..e932c4f 100644 --- a/src/coffee/controllers/mainCtrl.coffee +++ b/src/coffee/controllers/mainCtrl.coffee @@ -15,6 +15,8 @@ timeTracker.controller 'MainCtrl', ($rootScope, $scope, $timeout, $location, $an $rootScope.messages = [] # Global state $scope.state = State + # Root font size + $scope.options = Option.getOptions() ### Initialize. diff --git a/src/coffee/services/option.coffee b/src/coffee/services/option.coffee index b1ac221..627c78d 100644 --- a/src/coffee/services/option.coffee +++ b/src/coffee/services/option.coffee @@ -15,6 +15,7 @@ timeTracker.factory("Option", ($q, Platform, Const, Log) -> itemsPerPage: 20 stepTime: 15 # minutes pomodoroTime: 25 # minutes + fontSize: 62.5 # % isCollapseIssues: false # issue section collapse isCollapseAccounts: false # accounts section collapse isCollapseOptions: false # options section collapse diff --git a/src/jade/_options.jade b/src/jade/_options.jade index eea0b58..c8a0124 100644 --- a/src/jade/_options.jade +++ b/src/jade/_options.jade @@ -34,6 +34,14 @@ div#options.bottom-space-m(ng-controller='OptionCtrl') div.setting__options input.form-control.input-sm.setting__input(type="number", name="pomodoroTime", max="60", min="1", ng-model="options.pomodoroTime") + div.setting__section.form-group + div.setting__labels + label.control-label Font size + div.setting__description + span min: 50, max: 100 + div.setting__options + input.form-control.input-sm.setting__input(type="number", name="fontSize", max="100", min="50", ng-model="options.fontSize") + div.setting__section.form-group div.setting__labels label.control-label Enable Project's Star diff --git a/src/jade/index.jade b/src/jade/index.jade index 72839b7..6f78e50 100644 --- a/src/jade/index.jade +++ b/src/jade/index.jade @@ -1,5 +1,5 @@ !!! 5 -html(ng-app='timeTracker', ng-csp="", ng-controller='MainCtrl') +html(ng-app='timeTracker', ng-csp="", style="font-size:{{options.fontSize}}%", ng-controller='MainCtrl') head meta(http-equiv='Content-Type', content='text/html; charset=UTF-8') diff --git a/src/stylus/components/switch.styl b/src/stylus/components/switch.styl index 9bf83e9..81f4571 100644 --- a/src/stylus/components/switch.styl +++ b/src/stylus/components/switch.styl @@ -5,7 +5,7 @@ input[type=radio].switch border-radius: 1.5rem background-color: #fff padding: .1rem - margin: -0.8rem + margin: -0.6rem display: inline-block width: 5.2rem height: 3.1rem diff --git a/src/stylus/main.styl b/src/stylus/main.styl index f1e65c0..80ac15b 100644 --- a/src/stylus/main.styl +++ b/src/stylus/main.styl @@ -546,10 +546,9 @@ input.project-search .setting__options .btn-sm - font-size: .8rem + font-size: 1rem color: $color_font - margin: 0 0 0 .5rem - padding: .3rem .6rem + padding: .3rem .8rem &.loading background-color: #eee !important border-color: #adadad @@ -558,7 +557,7 @@ input.project-search margin-right: -0.6rem .setting__input - width: 3.7rem + width: 4.5rem text-align: right .modal-dialog