コード例 #1
0
        public static bool FontSettingsLinkClicked(CollectionSettings settings, string langName, int langNum1Based)
        {
            var langSpec = settings.LanguagesZeroBased[langNum1Based - 1];

            using (var frm = new ScriptSettingsDialog())
            {
                frm.LanguageName           = langName;
                frm.LanguageRightToLeft    = langSpec.IsRightToLeft;
                frm.LanguageLineSpacing    = langSpec.LineHeight;
                frm.UIFontSize             = langSpec.BaseUIFontSizeInPoints;
                frm.BreakLinesOnlyAtSpaces = langSpec.BreaksLinesOnlyAtSpaces;
                frm.ShowDialog();

                // get the changes

                // We usually don't need to restart, just gather the changes up. The caller
                // will save the .bloomCollection file. Later when a book
                // is edited, defaultLangStyles.css will be written out in the book's folder, which is all
                // that is needed for this setting to take effect.
                langSpec.LineHeight = frm.LanguageLineSpacing;
                langSpec.BreaksLinesOnlyAtSpaces = frm.BreakLinesOnlyAtSpaces;
                langSpec.BaseUIFontSizeInPoints  = frm.UIFontSize;
                if (frm.LanguageRightToLeft != langSpec.IsRightToLeft)
                {
                    langSpec.IsRightToLeft = frm.LanguageRightToLeft;
                    return(true);
                }
                return(false);
            }
        }
コード例 #2
0
        private void FontSettingsLinkClicked(string langName, int langNum)
        {
            using (var frm = new ScriptSettingsDialog())
            {
                frm.LanguageName        = langName;
                frm.LanguageRightToLeft = _collectionSettings.GetLanguageRtl(langNum);
                frm.LanguageLineSpacing = _collectionSettings.GetLanguageLineHeight(langNum);
                frm.ShowDialog(this);

                // get the changes
                var newRtl = frm.LanguageRightToLeft;
                var newLs  = frm.LanguageLineSpacing;

                if (newRtl != _collectionSettings.GetLanguageRtl(langNum))
                {
                    _collectionSettings.SetLanguageRtl(langNum, newRtl);
                    ChangeThatRequiresRestart();
                }

                if (newLs != _collectionSettings.GetLanguageLineHeight(langNum))
                {
                    _collectionSettings.SetLanguageLineHeight(langNum, newLs);
                    ChangeThatRequiresRestart();
                }
            }
        }
コード例 #3
0
        private void FontSettingsLinkClicked(string langName, int langNum)
        {
            using (var frm = new ScriptSettingsDialog())
            {
                frm.LanguageName           = langName;
                frm.LanguageRightToLeft    = _collectionSettings.GetLanguageRtl(langNum);
                frm.LanguageLineSpacing    = _collectionSettings.GetLanguageLineHeight(langNum);
                frm.BreakLinesOnlyAtSpaces = _collectionSettings.GetBreakLinesOnlyAtSpaces(langNum);
                frm.ShowDialog(this);

                // get the changes
                var newRtl   = frm.LanguageRightToLeft;
                var newLs    = frm.LanguageLineSpacing;
                var newBreak = frm.BreakLinesOnlyAtSpaces;

                if (newRtl != _collectionSettings.GetLanguageRtl(langNum))
                {
                    _collectionSettings.SetLanguageRtl(langNum, newRtl);
                    ChangeThatRequiresRestart();
                }

                if (newLs != _collectionSettings.GetLanguageLineHeight(langNum))
                {
                    // Clicking "OK" writes out settingsCollectionStyles.css which is all that is needed
                    // for this to take immediate effect.
                    _collectionSettings.SetLanguageLineHeight(langNum, newLs);
                }

                if (newBreak != _collectionSettings.GetBreakLinesOnlyAtSpaces(langNum))
                {
                    // Clicking "OK" writes out settingsCollectionStyles.css which is all that is needed
                    // for this to take immediate effect.
                    _collectionSettings.SetBreakLinesOnlyAtSpaces(langNum, newBreak);
                }
            }
        }
コード例 #4
0
        private void FontSettingsLinkClicked(string langName, int langNum)
        {
            using (var frm = new ScriptSettingsDialog())
            {
                frm.LanguageName = langName;
                frm.LanguageRightToLeft = _collectionSettings.GetLanguageRtl(langNum);
                frm.LanguageLineSpacing = _collectionSettings.GetLanguageLineHeight(langNum);
                frm.ShowDialog(this);

                // get the changes
                var newRtl = frm.LanguageRightToLeft;
                var newLs = frm.LanguageLineSpacing;

                if (newRtl != _collectionSettings.GetLanguageRtl(langNum))
                {
                    _collectionSettings.SetLanguageRtl(langNum, newRtl);
                    ChangeThatRequiresRestart();
                }

                if (newLs != _collectionSettings.GetLanguageLineHeight(langNum))
                {
                    _collectionSettings.SetLanguageLineHeight(langNum, newLs);
                    ChangeThatRequiresRestart();
                }
            }
        }