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; }
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; }