Skip to content

Commit

Permalink
Renamed functions
Browse files Browse the repository at this point in the history
Fixed tooltip for cruise control that before did not appear when cursor was in some cc item'a areas.
  • Loading branch information
TSK committed Jul 2, 2020
1 parent 472ecb5 commit 5f0cb90
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
FontWeight="Normal"
Text="{Binding CurrentStatus.FinishTime, Converter={StaticResource TimeToApproximateTimeConverter}}"
Visibility="{Binding CurrentStatus.FinishTime, Converter={StaticResource NullOrDefaultVisibilityConverter}}" />
<DockPanel>
<TextBlock/>
</DockPanel>
</DockPanel>
</DataTemplate>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override BuildStatusViewModel GetStatusViewModel()
/// Implements function that decides if a tooltip should be visible.
/// </summary>
/// <returns>True when should be visible, false when should not be visible.</returns>
public override bool IsTooltipVisible()
public override bool ShouldDisplayTooltip()
{
if (this.CurrentStatus is CruiseControlStatusViewModel status)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public virtual void Update(Connector changedConnector)
/// Implements function that decides if a tooltip should be visible.
/// </summary>
/// <returns>Base returns always true.</returns>
public virtual bool IsTooltipVisible()
public virtual bool ShouldDisplayTooltip()
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value is StatusViewModel status)
{
return status.Parent.IsTooltipVisible() ? Visibility.Visible : Visibility.Hidden;
return status.Parent.ShouldDisplayTooltip() ? Visibility.Visible : Visibility.Hidden;
}

return Visibility.Visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value is Soloplan.WhatsON.GUI.Configuration.Wizard.ProjectViewModel project)
{
return project.IsTooltipVisible() ? Visibility.Visible : Visibility.Hidden;
return project.ShouldDisplayTooltip() ? Visibility.Visible : Visibility.Hidden;
}

return Visibility.Visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

/// <summary>
/// Decides if a tooltip should be visible.
/// </summary>
/// <returns>True when should be visible, false when should not be visible.</returns>
public bool ShouldDisplayTooltip()
{
return (this.Description == string.Empty || this.Description == null) ? false : true;
}

/// <summary>
/// Updates the checked state of the groups(including parent groups).
/// </summary>
Expand All @@ -213,14 +222,5 @@ private void UpdateParentGroupsCheckedState()
currentParent = currentParent.Parent;
}
}

/// <summary>
/// Decides if a tooltip should be visible.
/// </summary>
/// <returns>True when should be visible, false when should not be visible.</returns>
public bool IsTooltipVisible()
{
return (this.Description == string.Empty || this.Description == null) ? false : true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</buildServer:ProgressBarControl>

<DockPanel>
<TextBlock />
<TextBlock/>
</DockPanel>
</DockPanel>
</DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public JenkinsProjectViewModel(Connector connector)
/// Implements function that decides if a tooltip should be visible.
/// </summary>
/// <returns>Base returns always true.</returns>
public override bool IsTooltipVisible()
public override bool ShouldDisplayTooltip()
{
if (this.CurrentStatus is JenkinsStatusViewModel status)
{
Expand Down

0 comments on commit 5f0cb90

Please sign in to comment.