Skip to content

A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.

C++
6.4 KB
Raw Blame
<UserControl
    x:Class="Gridex.DatabaseTypePickerDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <StackPanel Spacing="16" MinWidth="420">
        <TextBlock Text="Select a database type"
                   FontSize="14"
                   Foreground="{ThemeResource TextFillColorSecondaryBrush}" />

        <!-- Row 1: PostgreSQL, MySQL, SQLite -->
        <StackPanel Orientation="Horizontal" Spacing="12"
                    HorizontalAlignment="Center">
            <Button Tag="PostgreSQL" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#3B82F6" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE968;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="PostgreSQL" FontSize="12" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Tag="MySQL" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#06B6D4" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE968;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="MySQL" FontSize="12" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Tag="SQLite" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#8B5CF6" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE8E5;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="SQLite" FontSize="12" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
        </StackPanel>

        <!-- Row 2: Redis, MongoDB, SQL Server -->
        <StackPanel Orientation="Horizontal" Spacing="12"
                    HorizontalAlignment="Center">
            <Button Tag="Redis" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#DC382D" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE8D7;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="Redis" FontSize="12" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Tag="MongoDB" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#47A248" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE943;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="MongoDB" FontSize="12" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Tag="MSSQLServer" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#F97316" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE968;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="SQL Server" FontSize="11" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
        </StackPanel>
        <!-- Row 3: ClickHouse -->
        <StackPanel Orientation="Horizontal" Spacing="12"
                    HorizontalAlignment="Center">
            <Button Tag="ClickHouse" Click="TypeButton_Click"
                    Padding="16,12" CornerRadius="8"
                    Background="Transparent" BorderThickness="1"
                    BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
                <StackPanel Width="88" Spacing="8" HorizontalAlignment="Center">
                    <Border Width="48" Height="48" CornerRadius="12"
                            Background="#FFCC00" HorizontalAlignment="Center">
                        <FontIcon Glyph="&#xE968;" FontSize="24" Foreground="White" />
                    </Border>
                    <TextBlock Text="ClickHouse" FontSize="11" FontWeight="SemiBold"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
        </StackPanel>
    </StackPanel>
</UserControl>