Skip to content

Commit

Permalink
常にLightテーマになるように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaji255 committed Jun 3, 2023
1 parent 43976dd commit 5e29eaf
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 51 deletions.
17 changes: 14 additions & 3 deletions EasyPlot/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,27 @@ set terminal pngcairo
if (s.Title.Enabled)
builder.Append($"title \"{s.Title.Value}\" ");

if (g.IsWithLines)
if (g.IsWithLines && g.IsWithPoints)
{
builder.Append("with linespoints ");
if (g.LineType.Enabled)
builder.Append($"linetype {g.LineType.Value} ");
if (g.LineWidth.Enabled)
builder.Append($"linewith {g.LineWidth.Value} ");
if (g.PointsType.Enabled)
builder.Append($"pointtype {g.PointsType.Value} ");
if (g.PointsSize.Enabled)
builder.Append($"pointsize {g.PointsSize.Value} ");
}
else if (g.IsWithLines)
{
builder.Append("with lines ");
if (g.LineType.Enabled)
builder.Append($"linetype {g.LineType.Value} ");
if (g.LineWidth.Enabled)
builder.Append($"linewith {g.LineWidth.Value} ");
}

if (g.IsWithPoints)
else if (g.IsWithPoints)
{
builder.Append("with points ");
if (g.PointsType.Enabled)
Expand Down
95 changes: 48 additions & 47 deletions EasyPlot/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<FileImageSourceConverter x:Key="FISConverter" />
</ContentPage.Resources>

<Grid ColumnDefinitions="1*, 1*"
<Grid ColumnDefinitions="1*, 3, 1*"
ColumnSpacing="20"
Padding="10">
<Grid RowDefinitions="50,80,*">
Expand Down Expand Up @@ -129,7 +129,7 @@
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40, 1*, 3*"
RowDefinitions="*, *, *, *, *, *, *"
RowDefinitions="*, *, *, *, *, *, *"
Padding="15,0,15,0">
<CheckBox IsChecked="{Binding Title.Enabled}"
VerticalOptions="Center"/>
Expand Down Expand Up @@ -249,7 +249,8 @@

<!-- グラフ設定 -->
<Grid Grid.Row="2"
RowDefinitions="280,*"
RowDefinitions="280,3,*"
RowSpacing="5"
IsVisible="{Binding IsGraphSetting}">
<Grid RowDefinitions="*,*,*,*,*,*,*,*"
ColumnDefinitions="40,40,1*,4*">
Expand All @@ -259,6 +260,7 @@
VerticalOptions="Center"
HorizontalOptions="Center"/>
<Entry Grid.Column="1"
Margin="0,0,10,0"
Text="{Binding SelectedGroup.GroupTitle}"
Style="{StaticResource MainEntryStyle}"/>
<Button Grid.Column="2"
Expand Down Expand Up @@ -337,38 +339,36 @@
Style="{StaticResource MainEntryStyle}"/>
</Grid>

<Border Grid.Row="1">
</Border>

<Border Grid.Row="1"
Padding="5">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<CollectionView x:Name="GraphCollection"
<CollectionView Grid.Row="2"
x:Name="GraphCollection"
ItemsSource="{Binding SelectedGroup.Settings}">
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"
ItemSpacing="3"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Border Padding="5">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Grid ColumnDefinitions="40, 1*, 3*"
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Border Padding="5">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Grid ColumnDefinitions="40, 1*, 3*"
RowDefinitions="*,*,*,*">
<CheckBox IsChecked="{Binding TitleEnabled}"
<CheckBox IsChecked="{Binding TitleEnabled}"
VerticalOptions="Center"/>
<Label Grid.Column="1"
<Label Grid.Column="1"
Text="Title"
VerticalOptions="Center" />
<Grid Grid.Column="2"
<Grid Grid.Column="2"
ColumnDefinitions="*,50">
<Entry
<Entry
Text="{Binding TitleValue}"
BackgroundColor="{Binding TitleValueColor}"
Style="{StaticResource MainEntryStyle}"/>
<Button Grid.Column="1"
<Button Grid.Column="1"
Text="X"
BackgroundColor="Gray"
MaximumHeightRequest="40"
Expand All @@ -378,63 +378,64 @@
VerticalOptions="Center"
Command="{Binding Source={x:Reference GraphCollection}, Path=BindingContext.SelectedGroup.RemoveSettingCommand}"
CommandParameter="{Binding Model.Id}"/>
</Grid>
</Grid>

<RadioButton Grid.Row="1" Grid.ColumnSpan="2"
<RadioButton Grid.Row="1" Grid.ColumnSpan="2"
Content="Function"
IsChecked="{Binding IsFunction}" />
<Entry Grid.Row="1" Grid.Column="2"
<Entry Grid.Row="1" Grid.Column="2"
Text="{Binding FunctionText}"
BackgroundColor="{Binding FunctionTextColor}"
Style="{StaticResource MainEntryStyle}" />

<RadioButton Grid.Row="2" Grid.ColumnSpan="2"
<RadioButton Grid.Row="2" Grid.ColumnSpan="2"
Content="Data File"
IsChecked="{Binding IsDataFile}"/>
<Grid Grid.Row="2" Grid.Column="2"
<Grid Grid.Row="2" Grid.Column="2"
ColumnDefinitions="*,50">
<Label Text="{Binding DataFileName}"
<Label Text="{Binding DataFileName}"
LineBreakMode="TailTruncation"
VerticalOptions="Center"/>
<Button Grid.Column="1"
<Button Grid.Column="1"
Text="🗀"
Command="{Binding OpenFilePickerCommand}"/>
</Grid>
</Grid>


<HorizontalStackLayout Grid.Row="3" Grid.Column="1">
<CheckBox IsChecked="{Binding UsingRangeEnabled}"
<HorizontalStackLayout Grid.Row="3" Grid.Column="1">
<CheckBox IsChecked="{Binding UsingRangeEnabled}"
IsEnabled="{Binding IsDataFile}"
VerticalOptions="Center"/>
<Label Text="Using"
<Label Text="Using"
VerticalOptions="Center" />
</HorizontalStackLayout>
<Grid Grid.Row="3" Grid.Column="2"
</HorizontalStackLayout>
<Grid Grid.Row="3" Grid.Column="2"
ColumnDefinitions="*,15,*">
<Entry Text="{Binding UsingRangeStart}"
<Entry Text="{Binding UsingRangeStart}"
IsEnabled="{Binding IsDataFile}"
BackgroundColor="{Binding UsingRangeTextColor}"
Style="{StaticResource MainEntryStyle}" />
<Label Grid.Column="1"
<Label Grid.Column="1"
Text=":"
VerticalOptions="Center"
HorizontalOptions="Center" />
<Entry Grid.Column="2"
<Entry Grid.Column="2"
Text="{Binding UsingRangeEnd}"
IsEnabled="{Binding IsDataFile}"
BackgroundColor="{Binding UsingRangeTextColor}"
Style="{StaticResource MainEntryStyle}" />
</Grid>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Border>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</Grid>

<Grid Grid.Column="1"
<Border Grid.Column="1" />

<Grid Grid.Column="2"
RowDefinitions="*, 80">
<Label Text="{Binding ErrorText}"
IsVisible="{Binding IsGenerateError}" />
Expand Down
2 changes: 1 addition & 1 deletion EasyPlot/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public partial class MainPage : ContentPage
public MainPage()
{
InitializeComponent();

Application.Current!.UserAppTheme = AppTheme.Light;
}
}

0 comments on commit 5e29eaf

Please sign in to comment.