void InitializeWhatNewView() { if (BookInfo == null) { return; } WhatNewLabel.StringValue = "What's New"; CurrentDayLabel.StringValue = BookInfo.LastUpdatedDate.Value.ToString("dd MMM yyyy"); nfloat height = HeightOfWhatNewInfoView(); if (height > TEXTVIEW_SIXLINE_HEIGHT) { NSButton moreButton = CreateMoreButton(); DescriptionView.WantsLayer = true; moreButton.Action = new Selector("WhatNewViewShowAll:"); moreButton.Target = this; DescriptionView.AddSubview(moreButton); isDescripExpand = false; } else { nfloat orgHeight = DespTextField.Frame.Size.Height; nfloat offset = height - orgHeight; var oldSize = DescriptionView.Frame.Size; var newSize = new CGSize(oldSize.Width, descriptionViewHeight + offset); DescriptionView.SetFrameSize(newSize); //LayoutSubViews (); } }
void DescriptionShowAll(NSObject sender) { float fontSize = 13.0f; nfloat height = HeightWrappedToWidth(DespTextField, fontSize); if (!isDescripExpand) { nfloat orgHeight = DespTextField.Frame.Size.Height; nfloat offset = height - orgHeight; var oldSize = DescriptionView.Frame.Size; var newSize = new CGSize(oldSize.Width, descriptionViewHeight + offset); DescriptionView.SetFrameSize(newSize); var button = (NSButton)DescriptionView.Subviews [3]; NSAttributedString title = Utility.AttributeTitle("...less", Utility.ColorWithRGB(44, 117, 252, 1.0f), 12); button.Cell.AttributedTitle = title; isDescripExpand = true; } else { var oldSize = DescriptionView.Frame.Size; var newSize = new CGSize(oldSize.Width, descriptionViewHeight); DescriptionView.SetFrameSize(newSize); var button = (NSButton)DescriptionView.Subviews [3]; NSAttributedString title = Utility.AttributeTitle("...more", Utility.ColorWithRGB(44, 117, 252, 1.0f), 12); button.Cell.AttributedTitle = title; isDescripExpand = false; } LayoutSubViews(); }
void InitializeDescriptionView() { if (BookInfo == null) { return; } float fontSize = 13.0f; string description = "3. Verify return to filter option page for Subscription " + "Given successful login with navigation to My Publications page, " + "When filtering books by 'Subscription' option \n" + "and selecting a Subscription title using TOC icon, " + "Then returning back to My Publications screen will maintain the list of filtered titles.338\n" + "When clicking the download icon on the subscribed download book, " + "showing the download progress and a cancel icon at end of progress bar\n" + "3. Cancel download progress this is"; DespTextField.StringValue = description; if (BookInfo.Description != null) { DespTextField.StringValue = BookInfo.Description; } descriptionViewHeight = DescriptionView.Frame.Size.Height; var height = HeightWrappedToWidth(DespTextField, fontSize); if (height > TEXTVIEW_SIXLINE_HEIGHT) { NSButton moreButton = CreateMoreButton(); DescriptionView.WantsLayer = true; moreButton.Action = new Selector("DescriptionShowAll:"); moreButton.Target = this; DescriptionView.AddSubview(moreButton); isDescripExpand = false; } else { nfloat orgHeight = DespTextField.Frame.Size.Height; nfloat offset = height - orgHeight; var oldSize = DescriptionView.Frame.Size; var newSize = new CGSize(oldSize.Width, descriptionViewHeight + offset); DescriptionView.SetFrameSize(newSize); //LayoutSubViews (); } }