33#include < interfaces/management_layer/i_document_manager.h>
44#include < ui/design_system/design_system.h>
55#include < ui/modules/logline_generator/logline_generator_dialog.h>
6+ #include < ui/widgets/button/button.h>
67#include < ui/widgets/card/card.h>
78#include < ui/widgets/check_box/check_box.h>
89#include < ui/widgets/scroll_bar/scroll_bar.h>
@@ -24,6 +25,10 @@ class ScreenplayInformationView::Implementation
2425
2526 QScrollArea* content = nullptr ;
2627
28+ Card* checkingInfo = nullptr ;
29+ TextField* checkingComment = nullptr ;
30+ Button* sendForChecking = nullptr ;
31+
2732 Card* screenplayInfo = nullptr ;
2833 QGridLayout* screenplayInfoLayout = nullptr ;
2934 TextField* screenplayName = nullptr ;
@@ -38,6 +43,9 @@ class ScreenplayInformationView::Implementation
3843
3944ScreenplayInformationView::Implementation::Implementation (QWidget* _parent)
4045 : content(new QScrollArea(_parent))
46+ , checkingInfo(new Card(_parent))
47+ , checkingComment(new TextField(checkingInfo))
48+ , sendForChecking(new Button(checkingInfo))
4149 , screenplayInfo(new Card(_parent))
4250 , screenplayInfoLayout(new QGridLayout)
4351 , screenplayName(new TextField(screenplayInfo))
@@ -70,6 +78,11 @@ ScreenplayInformationView::Implementation::Implementation(QWidget* _parent)
7078 screenplayLogline,
7179 });
7280
81+ auto checkingLayout = UiHelper::makeHBoxLayout ();
82+ checkingLayout->addWidget (checkingComment, 1 );
83+ checkingLayout->addWidget (sendForChecking);
84+ checkingInfo->setContentLayout (checkingLayout);
85+
7386 screenplayInfoLayout->setContentsMargins ({});
7487 screenplayInfoLayout->setSpacing (0 );
7588 int row = 0 ;
@@ -92,9 +105,12 @@ ScreenplayInformationView::Implementation::Implementation(QWidget* _parent)
92105 QVBoxLayout* layout = new QVBoxLayout;
93106 layout->setContentsMargins ({});
94107 layout->setSpacing (0 );
108+ layout->addWidget (checkingInfo);
95109 layout->addWidget (screenplayInfo);
96110 layout->addStretch ();
97111 contentWidget->setLayout (layout);
112+
113+ checkingInfo->hide ();
98114}
99115
100116
@@ -113,6 +129,9 @@ ScreenplayInformationView::ScreenplayInformationView(QWidget* _parent)
113129 layout->addWidget (d->content );
114130 setLayout (layout);
115131
132+ connect (d->sendForChecking , &Button::clicked, this ,
133+ [this ] { emit sendDocumentToReviewRequested (d->checkingComment ->text ()); });
134+
116135 connect (d->screenplayName , &TextField::textChanged, this ,
117136 [this ] { emit nameChanged (d->screenplayName ->text ()); });
118137 connect (d->screenplayTagline , &TextField::textChanged, this ,
@@ -170,13 +189,26 @@ QWidget* ScreenplayInformationView::asQWidget()
170189 return this ;
171190}
172191
192+ void ScreenplayInformationView::setProjectInfo (bool _isRemote, bool _isOwner,
193+ bool _allowGrantAccessToProject,
194+ bool _canBeSentForChecking)
195+ {
196+ Q_UNUSED (_isRemote)
197+ Q_UNUSED (_isOwner)
198+ Q_UNUSED (_allowGrantAccessToProject)
199+
200+ d->checkingInfo ->setVisible (_canBeSentForChecking);
201+ }
202+
173203void ScreenplayInformationView::setEditingMode (ManagementLayer::DocumentEditingMode _mode)
174204{
175205 const auto readOnly = _mode != ManagementLayer::DocumentEditingMode::Edit;
206+ d->checkingComment ->setReadOnly (readOnly);
176207 d->screenplayName ->setReadOnly (readOnly);
177208 d->screenplayTagline ->setReadOnly (readOnly);
178209 d->screenplayLogline ->setReadOnly (readOnly);
179210 const auto enabled = !readOnly;
211+ d->sendForChecking ->setEnabled (enabled);
180212 d->titlePageVisiblity ->setEnabled (enabled);
181213 d->synopsisVisiblity ->setEnabled (enabled);
182214 d->treatmentVisiblity ->setEnabled (enabled);
@@ -238,6 +270,9 @@ void ScreenplayInformationView::setScreenplayStatisticsVisible(bool _visible)
238270
239271void ScreenplayInformationView::updateTranslations ()
240272{
273+ d->checkingComment ->setLabel (tr (" Comment" ));
274+ d->sendForChecking ->setText (tr (" Send for checking" ));
275+
241276 d->screenplayName ->setLabel (tr (" Screenplay name" ));
242277 d->screenplayTagline ->setLabel (tr (" Tagline" ));
243278 d->screenplayLogline ->setLabel (tr (" Logline" ));
@@ -253,30 +288,40 @@ void ScreenplayInformationView::designSystemChangeEvent(DesignSystemChangeEvent*
253288{
254289 Widget::designSystemChangeEvent (_event);
255290
256- setBackgroundColor (Ui:: DesignSystem::color ().surface ());
291+ setBackgroundColor (DesignSystem::color ().surface ());
257292
258293 d->content ->widget ()->layout ()->setContentsMargins (
259- QMarginsF (Ui::DesignSystem::layout ().px24 (),
260- Ui::DesignSystem::compactLayout ().topContentMargin (),
261- Ui::DesignSystem::layout ().px24 (), Ui::DesignSystem::compactLayout ().px24 ())
294+ QMarginsF (DesignSystem::layout ().px24 (), DesignSystem::compactLayout ().topContentMargin (),
295+ DesignSystem::layout ().px24 (), DesignSystem::compactLayout ().px24 ())
262296 .toMargins ());
263297
298+ d->checkingInfo ->setBackgroundColor (DesignSystem::color ().background ());
264299 d->screenplayInfo ->setBackgroundColor (DesignSystem::color ().background ());
265- for (auto textField : { d->screenplayName , d->screenplayTagline , d->screenplayLogline }) {
266- textField->setBackgroundColor (Ui::DesignSystem::color ().onBackground ());
267- textField->setTextColor (Ui::DesignSystem::color ().onBackground ());
300+ for (auto textField :
301+ { d->checkingComment , d->screenplayName , d->screenplayTagline , d->screenplayLogline }) {
302+ textField->setBackgroundColor (DesignSystem::color ().onBackground ());
303+ textField->setTextColor (DesignSystem::color ().onBackground ());
268304 }
269305 for (auto checkBox : { d->titlePageVisiblity , d->synopsisVisiblity , d->treatmentVisiblity ,
270306 d->screenplayTextVisiblity , d->screenplayStatisticsVisiblity }) {
271- checkBox->setBackgroundColor (Ui:: DesignSystem::color ().background ());
272- checkBox->setTextColor (Ui:: DesignSystem::color ().onBackground ());
307+ checkBox->setBackgroundColor (DesignSystem::color ().background ());
308+ checkBox->setTextColor (DesignSystem::color ().onBackground ());
273309 }
274- d->screenplayInfoLayout ->setVerticalSpacing (Ui::DesignSystem::compactLayout ().px16 ());
275- d->screenplayInfoLayout ->setRowMinimumHeight (
276- 0 , static_cast <int >(Ui::DesignSystem::layout ().px24 ()));
310+ d->checkingComment ->setCustomMargins (
311+ { DesignSystem::layout ().px24 (), DesignSystem::compactLayout ().px24 (),
312+ DesignSystem::layout ().px24 (), DesignSystem::compactLayout ().px24 () });
313+ d->sendForChecking ->setBackgroundColor (DesignSystem::color ().accent ());
314+ d->sendForChecking ->setTextColor (DesignSystem::color ().accent ());
315+ d->sendForChecking ->setContentsMargins (0 , DesignSystem::compactLayout ().px16 (),
316+ DesignSystem::compactLayout ().px16 (),
317+ DesignSystem::layout ().px16 ());
318+ d->checkingInfo ->layout ()->setSpacing (DesignSystem::layout ().px16 ());
319+ d->screenplayInfoLayout ->setVerticalSpacing (DesignSystem::compactLayout ().px16 ());
320+ d->screenplayInfoLayout ->setRowMinimumHeight (0 ,
321+ static_cast <int >(DesignSystem::layout ().px24 ()));
277322 d->screenplayInfoLayout ->setRowMinimumHeight (
278323 d->screenplayInfoLayout ->rowCount () - 1 ,
279- static_cast <int >(Ui:: DesignSystem::compactLayout ().px24 ()));
324+ static_cast <int >(DesignSystem::compactLayout ().px24 ()));
280325}
281326
282327} // namespace Ui
0 commit comments