Skip to content

Commit

Permalink
Merge pull request #1093 from stevencohn/1091-keep-highlight
Browse files Browse the repository at this point in the history
Keep rotating highlight color
  • Loading branch information
stevencohn authored Aug 21, 2023
2 parents a75bb8e + f79ac7a commit 4294fe1
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 3 deletions.
7 changes: 6 additions & 1 deletion OneMore/AddInCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ public async Task GotoFavoriteCmd(IRibbonControl control)

[Command("ribHighlightButton_Label", Keys.Control | Keys.Shift | Keys.H, "ribEditMenu")]
public async Task HighlightCmd(IRibbonControl control)
=> await factory.Run<HighlightCommand>();
=> await factory.Run<HighlightCommand>(1);


[Command("ribHighlightLastButton_Label", Keys.Control | Keys.Shift | Keys.J, "ribEditMenu")]
public async Task HighlightLastCmd(IRibbonControl control)
=> await factory.Run<HighlightCommand>(0);


[Command("ribHighlightFormulaButton_Label", Keys.None, "ribTableMenu")]
Expand Down
10 changes: 8 additions & 2 deletions OneMore/Commands/Edit/HighlightCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ public HighlightCommand()

public override async Task Execute(params object[] args)
{
var increment = (int)args[0];

using var one = new OneNote(out var page, out var ns);
var updated = false;
var index = 0;

var meta = page.GetMetaContent(MetaNames.HighlightIndex);
if (meta != null)
{
if (int.TryParse(meta, out index))
if (int.TryParse(meta, out index) && increment > 0)
{
index = index < 4 ? index + 1 : 0;
}
Expand Down Expand Up @@ -60,7 +62,11 @@ public override async Task Execute(params object[] args)

if (updated)
{
page.SetMeta(MetaNames.HighlightIndex, index.ToString(CultureInfo.InvariantCulture));
if (increment > 0)
{
page.SetMeta(MetaNames.HighlightIndex, index.ToString(CultureInfo.InvariantCulture));
}

await one.Update(page);
}
}
Expand Down
9 changes: 9 additions & 0 deletions OneMore/Properties/Resources.Designer.cs

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

4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.ar-SA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2832,6 +2832,10 @@ ISO-code then comma then language name</comment>
<value>خلايا عالية مع صيغة في الجدول الحالي</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>قم بتمييز النص بأحدث قلم تمييز</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>الصور</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,10 @@ Polaroid</value>
<value>Hohe Zellen mit Formel in der aktuellen Tabelle</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Markieren Sie Text mit dem neuesten Textmarker</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Bilder</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2832,6 +2832,10 @@ polaroid</value>
<value>Celdas altas con fórmula en la tabla actual</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Resaltar texto con el resaltador más reciente</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Imagenes</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,10 @@ Polaroïd</value>
<value>Cellules hautes avec formule dans le tableau actuel</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Surligner le texte avec le surligneur le plus récent</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Images</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.he-IL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2853,6 +2853,10 @@ ISO-code then comma then language name</comment>
<value>תאים גבוהים עם נוסחה בטבלה הנוכחית</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>הדגש טקסט עם ההדגשה העדכנית ביותר</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>תמונות</value>
<comment>Ribbon OneMore menu item, Images... NODUP</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.nl-NL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,10 @@ Polaroid</value>
<value>Hoge cellen met formule in huidige tabel</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Markeer tekst met de meest recente markeerstift</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Afbeeldingen</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.pl-PL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,10 @@ Polaroid</value>
<value>Wysokie komórki o wzorze w bieżącej tabeli</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Podświetl tekst najnowszym zakreślaczem</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Obrazy</value>
<comment>Ribbon OneMore menu item, Images... NODUP</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,10 @@ Polaroid.</value>
<value>Células altas com fórmula na tabela atual</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Destaque o texto com o marcador mais recente</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Imagens</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,10 @@ Polaroid</value>
<value>High cells with formula in current table</value>
<comment>ribbon table</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>Highlight text with most recent highlighter</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>Images</value>
<comment>menu NODUP</comment>
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,10 @@ ISO-code then comma then language name</comment>
<value>当前表中具有公式的高级单元格</value>
<comment>Ribbon OneMore menu item, Formula...</comment>
</data>
<data name="ribHighlightLastButton_Label" xml:space="preserve">
<value>使用最新的荧光笔突出显示文本</value>
<comment>ribbon edit</comment>
</data>
<data name="ribImagesMenu_Label" xml:space="preserve">
<value>图片</value>
<comment>Ribbon OneMore menu item, Images...</comment>
Expand Down

0 comments on commit 4294fe1

Please sign in to comment.