new option for overriding font size

This commit is contained in:
Tor Hveem 2014-07-07 16:09:25 +02:00
parent 16f9897964
commit 6a3b4a1506
2 changed files with 12 additions and 1 deletions

View file

@ -368,10 +368,15 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</form>
</li>
<li>
Override font
Override font family
<br>
<input type="text" ng-model="fontfamily">
</li>
<li>
Override font size (E.g. 16px)
<br>
<input type="text" ng-model="fontsize" placeholder="14px">
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">

View file

@ -844,6 +844,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$store.bind($scope, "soundnotification", false);
// Save setting for font family
$store.bind($scope, "fontfamily", angular.element('.monospace').css('font-family'));
// Save setting for font size
$store.bind($scope, "fontsize", angular.element('.monospace').css('font-size'));
// Save setting for displaying embeds in rootScope so it can be used from service
$rootScope.visible = $scope.noembed === false;
@ -896,6 +898,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$scope.$watch('fontfamily', function() {
angular.element('.monospace').css('font-family', $scope.fontfamily);
});
// Update font size when changed
$scope.$watch('fontsize', function() {
angular.element('.monospace').css('font-size', $scope.fontsize);
});
$scope.setActiveBuffer = function(bufferId, key) {
// If we are on mobile we need to collapse the menu on sidebar clicks