public ITextViewWhitespace GetWhitespace(ISettings settings)
        {
            var visibleWhitespace = new BoolSetting("VisibleWhitespace", false, settings);
            var numSpacesPerTab   = new IntSetting("NumSpacesPerTab", 4, settings);

            return(new TextViewWhitespace(visibleWhitespace, numSpacesPerTab));
        }
		public IFontManager GetFontManager(ISettings settings)
		{
			string defaultFontName = "SourceCodePro-Regular";
			int defaultSize = 14;
			var _currentFontName = new StringSetting("CurrentFontName", defaultFontName, settings);
			var _currentFontSize = new IntSetting("CurrentFontSize", defaultSize, settings);
			return new FontManager(_currentFontName, _currentFontSize);
		}
		public TextViewWhitespace(BoolSetting showWhitespace, IntSetting numSpacesPerTab)
		{
			_showWhitespace = showWhitespace;
			_numSpacesPerTab = numSpacesPerTab;
			_numSpacesPerTab.Changed += (sender, args) => Init();

			if (_numSpacesPerTab.Value < 1)
				_numSpacesPerTab.Value = 1;
		}
		void Init(Rect screenActivatorRect, CodeCompletionWindowInput input, ISettings settings)
		{
			_input = input;
			_activatorRect = screenActivatorRect;
			_userWidth = settings.GetSetting("PopupUserWidth") as IntSetting ?? new IntSetting("PopupUserWidth", -1, settings);
			_userHeight = settings.GetSetting("PopupUserHeight") as IntSetting ?? new IntSetting("PopupUserHeight", -1, settings);

			ShowAsDropDown(screenActivatorRect, GetWindowSize());
			Repaint();
		}
예제 #5
0
        public TextViewWhitespace(BoolSetting showWhitespace, IntSetting numSpacesPerTab)
        {
            _showWhitespace           = showWhitespace;
            _numSpacesPerTab          = numSpacesPerTab;
            _numSpacesPerTab.Changed += (sender, args) => Init();

            if (_numSpacesPerTab.Value < 1)
            {
                _numSpacesPerTab.Value = 1;
            }
        }
		public SettingsDialog(ITextView textView)
		{
			_settings = textView.Settings;
			_mouseCursorsRegions = textView.MouseCursorsRegions;
			_mouseCursors = textView.MouseCursors;
			_fontManager = textView.FontManager;
			_classificationStyler = textView.Document.ClassificationStyler;
			_appearance = textView.Appearance;

			_colorSchemeIndex = new IntSetting("ColorSchemeIndex", 0, _settings);
			_colorSchemeIndex.Changed += (sender, args) => SetClassificationColors();

			_fontSizes = _fontManager.GetCurrentFontSizes();
			_fontSizesNames = _fontSizes.Select(size => new GUIContent(size.ToString())).ToArray();
			SetClassificationColors();
		}
		public FontManager(StringSetting currentFontName, IntSetting currentFontSize)
		{
			_currentFontName = currentFontName;
			_currentFontSize = currentFontSize;
			InitIfNeeded();
		}
		public ITextViewWhitespace GetWhitespace(ISettings settings)
		{
			var visibleWhitespace = new BoolSetting("VisibleWhitespace", false, settings);
			var numSpacesPerTab = new IntSetting("NumSpacesPerTab", 4, settings);
			return new TextViewWhitespace(visibleWhitespace, numSpacesPerTab);
		}