diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -864,74 +864,39 @@ view->setVTFont(profile->font()); // set scroll-bar position - int scrollBarPosition = profile->property(Profile::ScrollBarPosition); - - if (scrollBarPosition == Enum::ScrollBarLeft) { - view->setScrollBarPosition(Enum::ScrollBarLeft); - } else if (scrollBarPosition == Enum::ScrollBarRight) { - view->setScrollBarPosition(Enum::ScrollBarRight); - } else if (scrollBarPosition == Enum::ScrollBarHidden) { - view->setScrollBarPosition(Enum::ScrollBarHidden); - } - - bool scrollFullPage = profile->property(Profile::ScrollFullPage); - view->setScrollFullPage(scrollFullPage); + view->setScrollBarPosition(Enum::ScrollBarPositionEnum(profile->property(Profile::ScrollBarPosition))); + view->setScrollFullPage(profile->property(Profile::ScrollFullPage)); // show hint about terminal size after resizing view->setShowTerminalSizeHint(profile->showTerminalSizeHint()); // terminal features view->setBlinkingCursorEnabled(profile->blinkingCursorEnabled()); view->setBlinkingTextEnabled(profile->blinkingTextEnabled()); - - int tripleClickMode = profile->property(Profile::TripleClickMode); - view->setTripleClickMode(Enum::TripleClickModeEnum(tripleClickMode)); - + view->setTripleClickMode(Enum::TripleClickModeEnum(profile->property(Profile::TripleClickMode))); view->setAutoCopySelectedText(profile->autoCopySelectedText()); view->setControlDrag(profile->property(Profile::CtrlRequiredForDrag)); view->setDropUrlsAsText(profile->property(Profile::DropUrlsAsText)); view->setBidiEnabled(profile->bidiRenderingEnabled()); view->setLineSpacing(profile->lineSpacing()); view->setTrimLeadingSpaces(profile->property(Profile::TrimLeadingSpacesInSelectedText)); view->setTrimTrailingSpaces(profile->property(Profile::TrimTrailingSpacesInSelectedText)); - view->setOpenLinksByDirectClick(profile->property(Profile::OpenLinksByDirectClickEnabled)); - view->setUrlHintsModifiers(profile->property(Profile::UrlHintsModifiers)); - - int middleClickPasteMode = profile->property(Profile::MiddleClickPasteMode); - if (middleClickPasteMode == Enum::PasteFromX11Selection) { - view->setMiddleClickPasteMode(Enum::PasteFromX11Selection); - } else if (middleClickPasteMode == Enum::PasteFromClipboard) { - view->setMiddleClickPasteMode(Enum::PasteFromClipboard); - } - + view->setMiddleClickPasteMode(Enum::MiddleClickPasteModeEnum(profile->property(Profile::MiddleClickPasteMode))); view->setCopyTextAsHTML(profile->property(Profile::CopyTextAsHTML)); // margin/center view->setMargin(profile->property(Profile::TerminalMargin)); view->setCenterContents(profile->property(Profile::TerminalCenter)); // cursor shape - int cursorShape = profile->property(Profile::CursorShape); - - if (cursorShape == Enum::BlockCursor) { - view->setKeyboardCursorShape(Enum::BlockCursor); - } else if (cursorShape == Enum::IBeamCursor) { - view->setKeyboardCursorShape(Enum::IBeamCursor); - } else if (cursorShape == Enum::UnderlineCursor) { - view->setKeyboardCursorShape(Enum::UnderlineCursor); - } + view->setKeyboardCursorShape(Enum::CursorShapeEnum(profile->property(Profile::CursorShape))); // cursor color - if (profile->useCustomCursorColor()) { - const QColor &cursorColor = profile->customCursorColor(); - view->setKeyboardCursorColor(cursorColor); - } else { - // an invalid QColor is used to inform the view widget to - // draw the cursor using the default color( matching the text) - view->setKeyboardCursorColor(QColor()); - } + // an invalid QColor is used to inform the view widget to + // draw the cursor using the default color( matching the text) + view->setKeyboardCursorColor(profile->useCustomCursorColor() ? profile->customCursorColor() : QColor()); // word characters view->setWordCharacters(profile->wordCharacters()); @@ -941,7 +906,6 @@ // mouse wheel zoom view->setMouseWheelZoom(profile->mouseWheelZoomEnabled()); - view->setAlternateScrolling(profile->property(Profile::AlternateScrolling)); }