Skip to content

Commit

Permalink
Add option to separate OneMore into its own ribbon tab (#1728)
Browse files Browse the repository at this point in the history
* Add option to separate OneMore into its own ribbon tab
#1651

* undebug
  • Loading branch information
stevencohn authored Dec 26, 2024
1 parent 0ec4148 commit 4db4dca
Show file tree
Hide file tree
Showing 20 changed files with 2,770 additions and 1,090 deletions.
61 changes: 45 additions & 16 deletions OneMore/Commands/Settings/RibbonBarSheet.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 30 additions & 7 deletions OneMore/Commands/Settings/RibbonBarSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ public RibbonBarSheet(SettingsProvider provider) : base(provider)

formulaRibbonBox.Checked = settings.Get<bool>("formulaCommands");
formulaIconBox.Checked = formulaRibbonBox.Checked && settings.Get<bool>("formulaIconsOnly");

layoutBox.SelectedIndex = settings.Get("layout", "group") == "tab" ? 1 : 0;
}


private void ChangeSelectedLayout(object sender, System.EventArgs e)
{
var grouped = layoutBox.SelectedIndex == 0;
positionBox.Enabled = grouped;
hashtagsRibbonBox.Enabled = grouped;
hashtagsIconBox.Enabled = grouped;
editRibbonBox.Enabled = grouped;
editIconBox.Enabled = grouped;
formulaRibbonBox.Enabled = grouped;
formulaIconBox.Enabled = grouped;
}


Expand Down Expand Up @@ -97,17 +112,25 @@ public override bool CollectSettings()
var settings = provider.GetCollection(Name);
var updated = false;

var layout = layoutBox.SelectedIndex == 0 ? "group" : "tab";
if (settings.Add("layout", layout)) updated = true;

// NOTE that the indexes MUST match RibbonGroups enum or it will break user's
// established settings so may need migration if changed...

if (settings.Add("position", positionBox.SelectedIndex)) updated = true;
if (layout == "group")
{
// only update these if layout is 'group'; otherwise leave them as-is...

if (settings.Add("position", positionBox.SelectedIndex)) updated = true;

if (settings.Add("hashtagCommands", hashtagsRibbonBox.Checked)) updated = true;
if (settings.Add("hashtagIconsOnly", hashtagsIconBox.Checked)) updated = true;
if (settings.Add("editCommands", editRibbonBox.Checked)) updated = true;
if (settings.Add("editIconsOnly", editIconBox.Checked)) updated = true;
if (settings.Add("formulaCommands", formulaRibbonBox.Checked)) updated = true;
if (settings.Add("formulaIconsOnly", formulaIconBox.Checked)) updated = true;
if (settings.Add("hashtagCommands", hashtagsRibbonBox.Checked)) updated = true;
if (settings.Add("hashtagIconsOnly", hashtagsIconBox.Checked)) updated = true;
if (settings.Add("editCommands", editRibbonBox.Checked)) updated = true;
if (settings.Add("editIconsOnly", editIconBox.Checked)) updated = true;
if (settings.Add("formulaCommands", formulaRibbonBox.Checked)) updated = true;
if (settings.Add("formulaIconsOnly", formulaIconBox.Checked)) updated = true;
}

if (updated)
{
Expand Down
2 changes: 1 addition & 1 deletion OneMore/Commands/Settings/RibbonBarSheet.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<data name="hashtagsPicture.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAALgAAAA8CAYAAADVEnAJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
IAAAFiABZOhBBgAAC/tJREFUeF7tnQts1Vcdx0E3jYnGVzQuKr4wujET3o8xQJjKupayAmOjLZQBbjhj
HQAAFh0BtuQdywAAC/tJREFUeF7tnQts1Vcdx0E3jYnGVzQuKr4wujET3o8xQJjKupayAmOjLZQBbjhj
zDSr0cgyLQzGzHDYphLYpsI2cDgQmdBiS+m7PDYX5+YiZoZhtgluCAvz/fN8T8/v9vTXc/6Pskvvbc8n
+aX/8/z/zu98+7vnf7m3DAsEAoFAIBAYItCxbxN1fa3b1LWpDgTyF2r/MlHr0mhTfUz3QCA/oI7b3GKO
MjXGDA8EcheneNtvJmpTpn/KevPT1JlpAoHcIyNc25R4n9k6l75bMYp2fG8a/atpSbeoleCba2ZTZenl
Expand Down
2 changes: 2 additions & 0 deletions OneMore/OneMore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,8 @@
<Content Include="Ribbon\Images\ribInsertNoteBoxButton.png" />
<Content Include="Ribbon\Images\ribInsertWarnBoxButton.png" />
<Content Include="Ribbon\Images\ribNavigatorButton.png" />
<Content Include="Ribbon\RibbonTabOneMore.xml" />
<Content Include="Ribbon\RibbonTabHome.xml" />
<Content Include="UI\TagMap.png" />
<Content Include="Properties\Images\TextHighlightColorPicker.png" />
<Content Include="Properties\Images\UpArrow.png" />
Expand Down
Loading

0 comments on commit 4db4dca

Please sign in to comment.