コード例 #1
0
ファイル: CamerasLabels.cs プロジェクト: kuggaa/longomatch
        void FillCanvas()
        {
            LabelObject l;
            int         i = 0, w, h;
            double      requiredWidth;

            w            = StyleConf.TimelineLabelsWidth * 2;
            h            = StyleConf.TimelineCameraHeight;
            widget.Width = w;

            // Main camera
            l = new CameraLabelObject(w, h, i * h)
            {
                Name            = fileSet [0].Name,
                BackgroundColor = Config.Style.PaletteBackgroundLight
            };
            AddLabel(l);
            i++;

            // Periods
            l = new CameraLabelObject(w, h, i * h)
            {
                Name            = Catalog.GetString("Periods"),
                BackgroundColor = Config.Style.PaletteBackgroundLight
            };
            AddLabel(l);
            i++;

            // Secondary cams
            for (int j = 1; j < fileSet.Count; j++)
            {
                l = new CameraLabelObject(w, h, i * h)
                {
                    Name            = fileSet [j].Name,
                    BackgroundColor = Config.Style.PaletteBackground
                };
                AddLabel(l);
                i++;
            }

            requiredWidth = Objects.Max(la => (la as LabelObject).RequiredWidth);
            foreach (LabelObject label in Objects)
            {
                label.Width = requiredWidth;
            }
            widget.Width = requiredWidth;
        }
コード例 #2
0
        void FillCanvas()
        {
            LabelObject l;
            int i = 0, w, h;

            w = StyleConf.TimelineLabelsWidth * 2;
            h = StyleConf.TimelineCameraHeight;

            // Main camera
            l = new CameraLabelObject (w, h, i * h) {
                Name = fileSet [0].Name,
                BackgroundColor = App.Current.Style.PaletteBackgroundLight
            };
            AddLabel (l);
            i++;

            // Periods
            l = new CameraLabelObject (w, h, i * h) {
                Name = Catalog.GetString ("Periods"),
                BackgroundColor = App.Current.Style.PaletteBackgroundLight
            };
            AddLabel (l);
            i++;

            // Secondary cams
            for (int j = 1; j < fileSet.Count; j++) {
                l = new CameraLabelObject (w, h, i * h) {
                    Name = fileSet [j].Name,
                    BackgroundColor = App.Current.Style.PaletteBackground
                };
                AddLabel (l);
                i++;
            }

            double width = Objects.Max (la => (la as LabelObject).RequiredWidth);
            foreach (LabelObject label in Objects) {
                label.Width = width;
            }
            WidthRequest = (int)width;
        }