Titanium Extended (2 Viewers)

Brownard

Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    Power is back :)
    @ge2301 To get transitions for the home menu you need to edit the 'BackgroundBrush' resource in styles\OtherControls.xaml (very near the top), this defines the image control to use for the background. You just use the ImageSourceWrapper as usual on the image control, i.e.
    XML:
      <ResourceWrapper x:Key="BackgroundBrush">
        <VisualBrush x:Name="BackdropImageBackgroundBrush">
          <VisualBrush.Visual>
            <Image x:Name="BackdropImageBackground" Stretch="Fill">
                <Image.Source>
                    <ImageSourceWrapper Delay="0.5" DelayInOut="true" Transition="transitions\dissolve" TransitionDuration="0.5"
                        Source="{Binding Source={StaticResource BackgroundManagerModel}, Path=BackgroundImage}"
                        FallbackSource="background.png" />
                </Image.Source>
            </Image>
          </VisualBrush.Visual>
        </VisualBrush>
      </ResourceWrapper>

    I still need to look at how latest media is handled and whether it is extensible enough to handle games...
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Power is back :)
    @ge2301 To get transitions for the home menu you need to edit the 'BackgroundBrush' resource in styles\OtherControls.xaml (very near the top), this defines the image control to use for the background. You just use the ImageSourceWrapper as usual on the image control, i.e.
    Welcome back! :D Works like a charme. Thanks!
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    @ge2301 I've managed to fix the problems you were having with closing the hidden side menu. You need to adjust the HiddenMenuItemContainerStyle in styles\OtherControls.xaml so that Button.IsEnabled is bound to ListView.IsEnabled like so:
    XML:
    <Style x:Key="HiddenMenuItemContainerStyle" BasedOn="{ThemeResource DefaultItemContainerStyle}">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type ListViewItem}">
              <Button Style="{ThemeResource ButtonHiddenMenuStyle}"
                      Command="{DynamicResource ResourceKey=Menu_Command}"
                      IsEnabled="{Binding Enabled}" SetFocus="{Binding Path=Selected,Mode=OneTime}">
                <Button.IsEnabled>
                  <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}">
                    <!-- Consider the item's enabled state -->
                    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="IsEnabled"/>
                    <!-- In combination with the parent ListView's enabled state -->
                    <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListView}}" Path="IsEnabled"/>
                  </MultiBinding>
                </Button.IsEnabled>
                <Button.Triggers>
                  <Trigger Property="HasFocus" Value="True">
                    <Setter TargetName="ButtonControlRectangle" Property="IsVisible" Value="True"/>
                    <Setter TargetName="ItemLabel" Property="Color" Value="{ThemeResource TextColor}"/>
                  </Trigger>
                </Button.Triggers>
              </Button>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
    </Style>

    I feel like that ideally this shouldn't be necessary and that it just masks an underlying issue with the focus handling, probably something to do with conflicting SetFocusPrios, but it is how it is implemented in Titanium.

    I still need to have a go at implementing a MultiTrigger so mouse handling works properly...

    EDIT
    It works even better if you disable the menu button when the menu is open. That way focus always jumps straight back to the list when pressing right rather than to the menu button first:
    XML:
    <Button x:Name="MenuShowButton" Content="Menu" Style="{ThemeResource ButtonWideStyle_GrowOnly}"
             Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Height="180" Margin="20,0,0,0"
             IsEnabled="{Binding Source={StaticResource MenuModel},Path=!IsMenuOpen}"
             Command="{Command Source={StaticResource MenuModel}, Path=ToggleMenu}">     
      <Image Source="hiddenmenu_tab.png" Stretch="Uniform" Margin="0,0,0,0"/>
    </Button>
     
    Last edited:

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Again you are a genius (y)(y)(y) I wasted so much time in trying everything with the margins :whistle:
    Now it's working really well and it's far the best way accessing a hiddenmenu in MP2!
    Today I'll implement a "TopHiddenMenu" for the coverflow view, as you can not enter the current HiddenMenu due to the MI loop and autofocus function. But even without both functions it would be bad to scrol through 500 MI to the left, just to access a menu :D
    I hope thats working to have two hidden menus with same content in the background.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    It worked :D According to the layout (cover or another) the HiddenMenu settings are different.
    XML:
            <Grid x:Name="TopPanel" Margin="0,-1100,10,5" VerticalAlignment="Top"
                  Width="550" HorizontalAlignment="Center">
              <Grid.IsVisible>
                <Binding Source="{StaticResource ViewModeModel}" Path="LayoutType"
                         Converter="{StaticResource ExpressionValueConverter}" ConverterParameter="{}{0} == {LayoutType}.{CoverLayout}"/>
              </Grid.IsVisible>
    ...
    • In List- and GridView pressing "left" and the Menu slides out from the left. When pressing "right" it slides back and the MI is on focus.
    • in CoverView pressing "up" and the Menu slides out from the top . When pressing "down" it slides back and the MI is on focus.
    I'll implement the same for the power button now, so lot of button presses can be saved and we finally have a good navigation :)
    Unbenannt.jpg
     
    Last edited:

    Scheibes

    Portal Pro
    June 14, 2012
    817
    71
    39
    Home Country
    Germany Germany
    What does it mean, that Audio and Support Plugins in the first Post are red? Orange means inprogress i think. But red?
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Red = Not even started.
    But as always in MP2, this is not such a big issue. All plugins are always working with every skin. If no specific skin files are available the plugins are working with default skin files that are available for every plugin. Maybe they are not that good looking, but they are definitely working...
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    What does it mean, that Audio and Support Plugins in the first Post are red? Orange means inprogress i think. But red?
    • Audio is working 100% (green)
    • Image I will also complete within today, but not finished (orange)
    • The home screen is working well, but some features I planned are not yet implemented. I want at least to show an EPG summary (but the EPG part is broken at the moment with this skin. morpheus_xx is checking this) (orange)
    • Plugins skins are not started as Lehmden said. This is last priority and as I'm not owner of the plugins I want to implement all styles at once as all download packages need to be updated and the owener needs to be at least informed (red) :)
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I fear the power menu can not be implemented with the new style easily as it uses the SystemStateModel and all slide animations are referring to the MenuModel.
    The SystemStateModel does not offer pathes as "IsMenuOpen, OpenMenu, CloseMenu, ToggleMenu" etc.

    @Brownard, perhaps you have an idea, but this one will be really tricky.

    My temporal modifications to masterhomemenu.xaml:
    XML:
     <Grid x:Name="ContentPanel" Margin="0,0,10,-650" VerticalAlignment="Bottom" Grid.Row="2" Grid.Column="0"
                  Width="550" HorizontalAlignment="Center" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">>
                <Grid.Resources>
                  <Storyboard x:Key="SlideDownStoryboard" FillBehavior="HoldEnd">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" FillBehavior="HoldEnd" Storyboard.TargetName="TopPanel" Storyboard.TargetProperty="RenderTransform.Y">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                      <SplineDoubleKeyFrame KeyTime="00:00:00.20" Value="850"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </Grid.Resources>
                <Grid.Triggers>
                  <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Trigger.EnterActions>
                      <TriggerCommand Command="{Command Source={StaticResource MenuModel}, Path=OpenMenu}"/>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                      <TriggerCommand Command="{Command Source={StaticResource MenuModel}, Path=CloseMenu}"/>
                    </Trigger.ExitActions>
                  </Trigger>
                  <!-- Setting default state of menu to hidden -->
                  <EventTrigger RoutedEvent="Screen.Show">
                    <TriggerCommand Command="{Command Source={StaticResource MenuModel}, Path=CloseMenu}"/>
                  </EventTrigger>
                  <!-- Slide-In animation when the MenuModel.ShowMenu gets true -->
                  <DataTrigger Binding="{Binding Source={StaticResource MenuModel},Path=IsMenuOpen}" Value="True">
                    <DataTrigger.EnterActions>
                      <BeginStoryboard x:Name="SlideDown_BeginStoryboard" Storyboard="{ThemeResource SlideDownStoryboard}"/>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                      <StopStoryboard BeginStoryboardName="SlideDown_BeginStoryboard"/>
                    </DataTrigger.ExitActions>
                    <Setter TargetName="PowerMenu" Property="SetFocusPrio" Value="Highest" />
                    <Setter TargetName="PowerMenu" Property="SetFocus" Value="True" />
                  </DataTrigger>
                </Grid.Triggers>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="550"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition Height="800"/>
                </Grid.RowDefinitions>
                <Grid.RenderTransform>
                  <TranslateTransform Y="0"/>
                </Grid.RenderTransform>
                <!--Image Source="menu_fade.png" Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="-65,-168,-50,-50">
              </Image-->
                <Rectangle RadiusX="{ThemeResource DialogBorderCornerRadius}" RadiusY="{ThemeResource DialogBorderCornerRadius}"
                           HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,67,0">
                  <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="{ThemeResource DialogBackgroundGradient1Color}"/>
                      <GradientStop Color="{ThemeResource DialogBackgroundGradient2Color}" Offset="1"/>
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
          
                <ListView x:Name="PowerMenu" Style="{ThemeResource HiddenMenuListViewStyle}" Margin="20,10,80,10"
                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SetFocusPrio="Default"
                    ItemsSource="{Binding Source={StaticResource SystemStateModel},Path=ShutdownItems,Mode=OneTime}">
                  <ListView.Resources>
                    <CommandBridge x:Key="Menu_Command" Source="{StaticResource SystemStateModel}"
                                    Path="Select"
                                    Parameters="{LateBoundValue BindingValue={Binding}}"/>
                  </ListView.Resources>
                </ListView>
                <Button Grid.Row="0" Grid.Column="0" Style="{ThemeResource ButtonWideStyle_GrowOnly}" Opacity="1" VerticalAlignment="Top"
                        Command="{Command Source={Service WorkflowManager},Path=NavigatePush,Parameters=BBFA7DB7-5055-48D5-A904-0F0C79849369}"
                        IsVisible="{Binding Source={StaticResource MenuModel},Path=!IsHome}"
                        IsEnabled="{Binding Source={StaticResource MenuModel},Path=!IsMenuOpen}">
                  <Image Source="ShutdownIcon.png" />
                </Button>
              </Grid>
     

    Users who are viewing this thread

    Top Bottom