Merge pull request #384 from glowing-bear/default-font

Make sure that a favourite font is always set when using Glowing Bear.
This commit is contained in:
Lorenz Hübschle-Schneider 2014-07-26 13:44:38 +01:00
commit dc1ce08800
4 changed files with 18 additions and 18 deletions

View file

@ -257,10 +257,6 @@ input[type=text], input[type=password], #sendMessage, .badge {
min-height: 100%; min-height: 100%;
} }
.monospace {
font-family: 'Inconsolata', 'Consolas', 'Monaco', 'Ubuntu Mono', monospace;
}
#bufferlines { #bufferlines {
position: relative; position: relative;
height: 100%; height: 100%;
@ -478,10 +474,6 @@ h2 span, h2 small {
/* Mobile layout */ /* Mobile layout */
/* */ /* */
@media (max-width: 968px) { @media (max-width: 968px) {
.monospace {
/* readability on mobile +9001% */
font-family: sans-serif;
}
#bufferlines table { #bufferlines table {
border-collapse: separate; border-collapse: separate;

View file

@ -1,6 +1,6 @@
<form class="form form-horizontal" id="inputform" ng-submit="sendMessage()"> <form class="form form-horizontal" id="inputform" ng-submit="sendMessage()">
<div class="input-group"> <div class="input-group">
<textarea id="{{inputId}}" class="form-control monospace" ng-trim="false" rows="1" autocomplete="off" ng-model="command"> <textarea id="{{inputId}}" class="form-control favorite-font" ng-trim="false" rows="1" autocomplete="off" ng-model="command">
</textarea> </textarea>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default btn-primary">Send</button> <button class="btn btn-default btn-primary">Send</button>

View file

@ -60,11 +60,11 @@
<div class="form-group"> <div class="form-group">
<label class="control-label" for="host">WeeChat relay hostname and port number</label> <label class="control-label" for="host">WeeChat relay hostname and port number</label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control monospace" id="host" ng-model="host" placeholder="Address"> <input type="text" class="form-control favorite-font" id="host" ng-model="host" placeholder="Address">
<input type="text" class="form-control monospace" id="port" ng-model="port" placeholder="Port"> <input type="text" class="form-control favorite-font" id="port" ng-model="port" placeholder="Port">
</div> </div>
<label class="control-label" for="password">WeeChat relay password</label> <label class="control-label" for="password">WeeChat relay password</label>
<input type="password" class="form-control monospace" id="password" ng-model="password" placeholder="Password"> <input type="password" class="form-control favorite-font" id="password" ng-model="password" placeholder="Password">
<div class="alert alert-danger" ng-show="passwordError"> <div class="alert alert-danger" ng-show="passwordError">
Error: wrong password Error: wrong password
</div> </div>
@ -217,7 +217,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<ul class="nav nav-pills nav-stacked" ng-class="{'indented': (predicate === 'serverSortKey')}"> <ul class="nav nav-pills nav-stacked" ng-class="{'indented': (predicate === 'serverSortKey')}">
<li class="bufferfilter"> <li class="bufferfilter">
<form role="form"> <form role="form">
<input class="form-control monospace" type="text" id="bufferFilter" ng-model="search" ng-keydown="handleSearchBoxKey($event)" placeholder="Search"> <input class="form-control favorite-font" type="text" id="bufferFilter" ng-model="search" ng-keydown="handleSearchBoxKey($event)" placeholder="Search">
</form> </form>
</li> </li>
<li class="buffer" ng-class="{'active': buffer.active, 'indent': buffer.indent }" ng-repeat="(key, buffer) in (filteredBuffers = (getBuffers() | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate))"> <li class="buffer" ng-class="{'active': buffer.active, 'indent': buffer.indent }" ng-repeat="(key, buffer) in (filteredBuffers = (getBuffers() | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate))">
@ -228,7 +228,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</li> </li>
</ul> </ul>
</div> </div>
<div bindonce id="bufferlines" class="monospace" ng-swipe-right="showSidebar()" ng-swipe-left="hideSidebar()" ng-class="{'withnicklist': showNicklist}"> <div bindonce id="bufferlines" class="favorite-font" ng-swipe-right="showSidebar()" ng-swipe-left="hideSidebar()" ng-class="{'withnicklist': showNicklist}">
<div id="nicklist" ng-if="showNicklist" ng-swipe-right="closeNick()" class="vertical-line-left"> <div id="nicklist" ng-if="showNicklist" ng-swipe-right="closeNick()" class="vertical-line-left">
<ul class="nicklistgroup list-unstyled" ng-repeat="group in nicklist"> <ul class="nicklistgroup list-unstyled" ng-repeat="group in nicklist">
<li ng-repeat="nick in group.nicks|orderBy:'name'"> <li ng-repeat="nick in group.nicks|orderBy:'name'">

View file

@ -866,12 +866,20 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Save setting for playing sound on notification // Save setting for playing sound on notification
$store.bind($scope, "soundnotification", false); $store.bind($scope, "soundnotification", false);
// Save setting for font family // Save setting for font family
$store.bind($scope, "fontfamily", getClassStyle('monospace', 'fontFamily')); $store.bind($scope, "fontfamily", getClassStyle('favorite-font', 'fontFamily'));
// Save setting for font size // Save setting for font size
$store.bind($scope, "fontsize", getClassStyle('monospace', 'fontSize')); $store.bind($scope, "fontsize", getClassStyle('favorite-font', 'fontSize'));
// Save setting for readline keybindings // Save setting for readline keybindings
$store.bind($scope, "readlineBindings", false); $store.bind($scope, "readlineBindings", false);
if (!$scope.fontfamily) {
if ($rootScope.isMobileUi()) {
$scope.fontfamily = 'sans-serif';
} else {
$scope.fontfamily = "Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace";
}
}
// Save setting for displaying embeds in rootScope so it can be used from service // Save setting for displaying embeds in rootScope so it can be used from service
$rootScope.visible = $scope.noembed === false; $rootScope.visible = $scope.noembed === false;
@ -947,11 +955,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Update font family when changed // Update font family when changed
$scope.$watch('fontfamily', function() { $scope.$watch('fontfamily', function() {
changeClassStyle('monospace', 'fontFamily', $scope.fontfamily); changeClassStyle('favorite-font', 'fontFamily', $scope.fontfamily);
}); });
// Update font size when changed // Update font size when changed
$scope.$watch('fontsize', function() { $scope.$watch('fontsize', function() {
changeClassStyle('monospace', 'fontSize', $scope.fontsize); changeClassStyle('favorite-font', 'fontSize', $scope.fontsize);
}); });
// Crude scoping hack. The keypress listener does not live in the same scope as // Crude scoping hack. The keypress listener does not live in the same scope as
// the checkbox, so we need to transfer this between scopes here. // the checkbox, so we need to transfer this between scopes here.