Пример #1
0
        void Init()
        {
            _mainBox = new VBox
            {
                BackgroundColor = MonoDevelop.Ide.Gui.Styles.BackgroundColor,
                HeightRequest   = 500,
                WidthRequest    = 800
            };

            _headerFrameBox = new RoundedFrameBox
            {
                CornerRadiusTopLeft     = 6,
                CornerRadiusTopRight    = 6,
                CornerRadiusBottomLeft  = 0,
                CornerRadiusBottomRight = 0,
                BorderBottom            = false,
                BorderWidth             = 2,
                InnerBackgroundColor    = Styles.BackgroundColor
            };

            _headerBox = new HBox
            {
                HeightRequest = 36
            };

            _feedBox = new ComboBox
            {
                WidthRequest = 200
            };

            _searchEntry = new SearchTextEntry
            {
                PlaceholderText = "Filter samples",
                HeightRequest   = 24,
                WidthRequest    = 200
            };

            _contentFrameBox = new RoundedFrameBox
            {
                CornerRadius         = 0,
                BorderWidth          = 2,
                InnerBackgroundColor = Styles.BackgroundColor,
                Margin = new WidgetSpacing(0, -6, 0, 0)
            };

            _contentBox = new HBox();

            _samplesView = new TreeView
            {
                BackgroundColor         = Styles.BackgroundColor,
                GridLinesVisible        = GridLines.None,
                HeadersVisible          = false,
                BorderVisible           = false,
                UseAlternatingRowColors = true,
                WidthRequest            = 200
            };

            _nameField   = new DataField <string>();
            _sampleField = new DataField <Sample>();

            _samplesStore = new TreeStore(_nameField, _sampleField);

            _descriptionBox = new VBox
            {
                WidthRequest = 300
            };

            _titleLabel = new Label("Title")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _titleValueLabel = new Label();

            _descriptionLabel = new Label("Description")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _descriptionValueLabel = new Label
            {
                Wrap         = WrapMode.Word,
                WidthRequest = 150
            };

            _platformsLabel = new Label("Platforms")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _platformsBox = new VBox();

            _tagsLabel = new Label("Tags")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _tagsBox = new HBox();

            _authorTitleLabel = new Label("Author")
            {
                Font   = Font.SystemFont.WithScaledSize(1.25),
                Margin = new WidgetSpacing(0, 12, 0, 0)
            };

            _authorLabel = new Label();

            _previewBox = new VBox
            {
                WidthRequest = 300
            };

            _previewView = new Xwt.ImageView
            {
                BackgroundColor     = Colors.Gray,
                HorizontalPlacement = WidgetPlacement.End,
                VerticalPlacement   = WidgetPlacement.Start,
                Margin = new WidgetSpacing(2, 2, 2, 2)
            };

            _loadingSpinner = new MDSpinner
            {
                Animate = true
            };

            _buttonBox = new HBox();

            _cancelButton = new Button("Cancel");

            _continueButton = new Button("Continue")
            {
                BackgroundColor = Styles.BaseSelectionBackgroundColor,
                LabelColor      = Styles.BaseSelectionTextColor
            };
        }
Пример #2
0
        void Init()
        {
            _mainBox = new VBox();

            _headerBox = new HBox
            {
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _appNameLabel = new Label
            {
                Font = Font.SystemFont.WithSize(24)
            };

            _titleLabel = new Label("Dashboard")
            {
                Font = Font.SystemFont.WithSize(24)
            };

            _rangeBox = new HBox
            {
                HorizontalPlacement = WidgetPlacement.Center
            };

            _lastDayToggle = new ToggleButton("Today");

            _lastWeekToggle = new ToggleButton("Last Week")
            {
                Active = true
            };

            _lastMonthToggle = new ToggleButton("Last Month");

            _appsCombo = new ComboBox
            {
                VerticalPlacement = WidgetPlacement.Center,
                WidthRequest      = 250
            };

            _separator = new HSeparator();

            _contentBox = new VBox();

            _contentSpinner = new MDSpinner
            {
                Animate = true,
                Visible = false
            };

            _contentScroll = new ScrollView
            {
                BorderVisible = false
            };

            _contentScrollBox = new VBox();

            _firstBox = new HBox();

            _devicesFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _devicesBox = new VBox
            {
                HeightRequest = 300
            };

            _devicesTitleLabel = new Label("Devices")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _devicesPlotView = new PlotView
            {
                BorderWidth   = 0,
                HeightRequest = 200,
                WidthRequest  = 200,
                Visible       = true
            };

            _devicesPlotView.ModifyBg(Gtk.StateType.Normal, Styles.BaseBackgroundColor.ToGdkColor());

            _countriesFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _countriesBox = new VBox
            {
                HeightRequest = 300
            };

            _countriesTitleLabel = new Label("Countries")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _countriesPlotView = new PlotView
            {
                BorderWidth   = 0,
                HeightRequest = 200,
                WidthRequest  = 200,
                Visible       = true
            };

            _countriesPlotView.ModifyBg(Gtk.StateType.Normal, Styles.BaseBackgroundColor.ToGdkColor());

            _languagesFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _languagesBox = new VBox
            {
                HeightRequest = 300
            };

            _languagesTitleLabel = new Label("Languages")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _languagesPlotView = new PlotView
            {
                BorderWidth   = 0,
                HeightRequest = 200,
                WidthRequest  = 200,
                Visible       = true
            };

            _languagesPlotView.ModifyBg(Gtk.StateType.Normal, Styles.BaseBackgroundColor.ToGdkColor());

            _secondBox = new HBox();

            _usersFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _usersBox = new VBox
            {
                HeightRequest = 600
            };

            _usersTitleLabel = new Label("Active Users")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _usersPlotView = new PlotView
            {
                Visible = true
            };

            _usersPlotView.ModifyBg(Gtk.StateType.Normal, Styles.BaseBackgroundColor.ToGdkColor());

            _thirdBox = new HBox();

            _durationsFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _durationsBox = new VBox();

            _durationsTitleLabel = new Label("Session Durations")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _durationsView = new ListView
            {
                SelectionMode = SelectionMode.None,
                HeightRequest = 200,
                Margin        = new WidgetSpacing(6, 6, 6, 6)
            };

            _descriptionField = new DataField <string>();
            _countField       = new DataField <int>();

            _durationsStore = new ListStore(_descriptionField, _countField);

            _durationsView.Columns.Add(new ListViewColumn("", new TextCellView(_descriptionField)
            {
                Editable = false
            }));
            _durationsView.Columns.Add(new ListViewColumn("Count", new TextCellView(_countField)
            {
                Editable = false
            }));

            _durationsView.DataSource = _durationsStore;

            _statisticsFrameBox = new RoundedFrameBox
            {
                BackgroundColor = Styles.BaseBackgroundColor,
                Margin          = new WidgetSpacing(6, 6, 6, 6)
            };

            _statisticsBox = new VBox();

            _statisticsTitleLabel = new Label("Session Statistics")
            {
                Font   = Font.SystemFont.WithSize(14),
                Margin = new WidgetSpacing(6, 6, 6, 6)
            };

            _statisticsView = new ListView
            {
                SelectionMode = SelectionMode.None,
                HeightRequest = 100,
                Margin        = new WidgetSpacing(6, 6, 6, 6)
            };

            _statisticsDescriptionField = new DataField <string>();
            _statisticsCountField       = new DataField <double>();
            _statisticsChangeField      = new DataField <string>();

            _statisticsStore = new ListStore(_statisticsDescriptionField, _statisticsCountField, _statisticsChangeField);

            _statisticsView.Columns.Add(new ListViewColumn("", new TextCellView(_statisticsDescriptionField)
            {
                Editable = false
            }));
            _statisticsView.Columns.Add(new ListViewColumn("Count", new TextCellView(_statisticsCountField)
            {
                Editable = false
            }));
            _statisticsView.Columns.Add(new ListViewColumn("Change", new TextCellView(_statisticsChangeField)
            {
                Editable = false
            }));

            _statisticsView.DataSource = _statisticsStore;
        }