Skip to content

Commit

Permalink
v1.34 Minor updates
Browse files Browse the repository at this point in the history
Implemented Increase Line Spacing Before and After and other suggestions in #44.
  • Loading branch information
iappyx committed Jun 17, 2024
1 parent 8772099 commit fc4e8e8
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 6 deletions.
Binary file modified bin/InstrumentaPowerpointToolbar.ppam
Binary file not shown.
10 changes: 10 additions & 0 deletions src/CustomUI/CustomUI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@
</buttonGroup>
<buttonGroup id="buttonGroupIndent">
<gallery idMso="LineSpacingGalleryPowerPoint" showLabel="false" />
<splitButton id="IncreaseLineSpacingSplitButton" showLabel="false">
<button id="IncreaseLineSpacing" label="Increase line spacing" showLabel="false" imageMso="ParagraphSpacingIncrease" onAction="ObjectsIncreaseLineSpacing" />
<menu id="IncreaseLineSpacingMenu" itemSize="normal">
<button id="IncreaseLineSpacingBeforeAndAfter" label="Increase line spacing before and after" showLabel="false" imageMso="ParagraphSpacingIncrease" onAction="ObjectsIncreaseLineSpacingBeforeAndAfter" />
</menu>
</splitButton>
<splitButton id="DecreaseLineSpacingSplitButton" showLabel="false">
<button id="DecreaseLineSpacing" label="Decrease line spacing" showLabel="false" imageMso="ParagraphSpacingDecrease" onAction="ObjectsDecreaseLineSpacing" />
<menu id="DecreaseLineSpacingMenu" itemSize="normal">
<button id="DecreaseLineSpacingBeforeAndAfter" label="Decrease line spacing before and after" showLabel="false" imageMso="ParagraphSpacingDecrease" onAction="ObjectsDecreaseLineSpacingBeforeAndAfter" />
</menu>
</splitButton>
<button idMso="IndentIncrease" showLabel="false" />
<button idMso="IndentDecrease" showLabel="false" />
<gallery idMso="TextAlignGallery" showLabel="false" />
Expand Down
Binary file modified src/InstrumentaPowerpointToolbar.pptm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Modules/ModuleAbout.bas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Attribute VB_Name = "ModuleAbout"
Public InstrumentaVersion As String

Sub ShowAboutDialog()
InstrumentaVersion = "1.33"
InstrumentaVersion = "1.34"
AboutDialog.Label1.Caption = "Instrumenta Powerpoint Toolbar v" & InstrumentaVersion
AboutDialog.Show
End Sub
98 changes: 98 additions & 0 deletions src/Modules/ModuleObjectsText.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1102,3 +1102,101 @@ Sub ObjectsToggleAutoSizeLoop(SlideShape, AutoSizeNum)
End If

End Sub


Sub ObjectsIncreaseLineSpacingBeforeAndAfter()

Set MyDocument = Application.ActiveWindow

If Not (MyDocument.Selection.Type = ppSelectionShapes Or MyDocument.Selection.Type = ppSelectionText) Then
MsgBox "No shapes selected."
Else

If MyDocument.Selection.HasChildShapeRange Then

For i = 1 To MyDocument.Selection.ChildShapeRange.Count
ObjectsLineSpacingBeforeAndAfterLoop MyDocument.Selection.ChildShapeRange(i), 3
Next i

Else

For i = 1 To MyDocument.Selection.ShapeRange.Count

ObjectsLineSpacingBeforeAndAfterLoop MyDocument.Selection.ShapeRange(i), 3

Next i

End If

End If

End Sub

Sub ObjectsDecreaseLineSpacingBeforeAndAfter()

Set MyDocument = Application.ActiveWindow

If Not (MyDocument.Selection.Type = ppSelectionShapes Or MyDocument.Selection.Type = ppSelectionText) Then
MsgBox "No shapes selected."
Else

If MyDocument.Selection.HasChildShapeRange Then

For i = 1 To MyDocument.Selection.ChildShapeRange.Count
ObjectsLineSpacingBeforeAndAfterLoop MyDocument.Selection.ChildShapeRange(i), -3
Next i

Else

For i = 1 To MyDocument.Selection.ShapeRange.Count

ObjectsLineSpacingBeforeAndAfterLoop MyDocument.Selection.ShapeRange(i), -3

Next i

End If

End If

End Sub

Sub ObjectsLineSpacingBeforeAndAfterLoop(SlideShape, LineSpacingChange)

If SlideShape.Type = msoGroup Then

Set SlideShapeGroup = SlideShape.GroupItems

For Each SlideShapeChild In SlideShapeGroup
ObjectsLineSpacingBeforeAndAfterLoop SlideShapeChild, LineSpacingChange
Next

Else

If SlideShape.HasTextFrame Then

With SlideShape.TextFrame.TextRange.ParagraphFormat

If LineSpacingChange < 0 Then

If .SpaceBefore <= -LineSpacingChange Then
.SpaceBefore = 0
.SpaceAfter = 0
Else
.SpaceBefore = .SpaceBefore + LineSpacingChange
.SpaceAfter = .SpaceBefore
End If

ElseIf LineSpacingChange > 0 Then

.SpaceBefore = .SpaceBefore + LineSpacingChange
.SpaceAfter = .SpaceBefore

End If

End With

End If

End If

End Sub
2 changes: 1 addition & 1 deletion src/Modules/ModuleObjectsTransparency.bas
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Sub SetTransparency(ByVal shp As shape)

If shp.Fill.Type = msoFillSolid Then
currentFillTransparency = shp.Fill.Transparency
adjustedTransparency = currentFillTransparency + 0.1
adjustedTransparency = currentFillTransparency + 0.2

If adjustedTransparency > 1 Then
adjustedTransparency = 0
Expand Down
8 changes: 4 additions & 4 deletions v/1.33.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## You are using the latest version of Instrumenta!
## There is a new version available!

If you want to re-download it:
- Direct download: https://github.com/iappyx/Instrumenta/raw/main/bin/InstrumentaPowerpointToolbar.ppam
- More info: https://github.com/iappyx/Instrumenta/
You can download it here: https://github.com/iappyx/Instrumenta/raw/main/bin/InstrumentaPowerpointToolbar.ppam

More info: https://github.com/iappyx/Instrumenta/
5 changes: 5 additions & 0 deletions v/1.34.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## You are using the latest version of Instrumenta!

If you want to re-download it:
- Direct download: https://github.com/iappyx/Instrumenta/raw/main/bin/InstrumentaPowerpointToolbar.ppam
- More info: https://github.com/iappyx/Instrumenta/

0 comments on commit fc4e8e8

Please sign in to comment.