Merge lp:~unity-team/oxide/locationBarHeightOnScreenChange into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Gerry Boland
Status: Merged
Merged at revision: 1462
Proposed branch: lp:~unity-team/oxide/locationBarHeightOnScreenChange
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 80 lines (+17/-2)
3 files modified
qt/core/browser/oxide_qt_contents_view.cc (+6/-0)
qt/core/browser/oxide_qt_web_view.cc (+8/-2)
qt/core/browser/oxide_qt_web_view.h (+3/-0)
To merge this branch: bzr merge lp:~unity-team/oxide/locationBarHeightOnScreenChange
Reviewer Review Type Date Requested Status
Chris Coulson Needs Fixing
Michał Sawicz (community) Needs Fixing
Review via email: mp+293278@code.launchpad.net

Commit message

On screen scale change, need to recalculate the height of the location bar in terms of the new scale

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

../../../../qt/core/browser/oxide_qt_web_view.cc: In member function ‘virtual void oxide::qt::WebView::updateLocationBarHeight() const’:
../../../../qt/core/browser/oxide_qt_web_view.cc:942:44: error: passing ‘const oxide::qt::WebView’ as ‘this’ argument discards qualifiers [-fpermissive]
   setLocationBarHeight(location_bar_height_);
                                            ^
../../../../qt/core/browser/oxide_qt_web_view.cc:934:6: note: in call to ‘virtual void oxide::qt::WebView::setLocationBarHeight(int)’
 void WebView::setLocationBarHeight(int height) {

:/

review: Needs Fixing
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks, I've left a couple of comments inline

review: Needs Fixing
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks, there's a couple of bits that can be deleted now (see the comments inline)

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Yep, done that (hadn't pushed), but now the offset of the location bar is wrong. Investigating (and marked the MP WIP, to avoid annoying you until I'm ready)

Revision history for this message
Gerry Boland (gerboland) wrote :

Chris has tested and not seeing the issue I was finding. I blame a deployment problem on my end. I'm going to double-check it, but this should be good to go

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qt/core/browser/oxide_qt_contents_view.cc'
--- qt/core/browser/oxide_qt_contents_view.cc 2016-04-20 22:09:41 +0000
+++ qt/core/browser/oxide_qt_contents_view.cc 2016-04-29 13:18:57 +0000
@@ -54,6 +54,7 @@
54#include "oxide_qt_type_conversions.h"54#include "oxide_qt_type_conversions.h"
55#include "oxide_qt_web_context_menu.h"55#include "oxide_qt_web_context_menu.h"
56#include "oxide_qt_web_popup_menu.h"56#include "oxide_qt_web_popup_menu.h"
57#include "oxide_qt_web_view.h"
5758
58namespace oxide {59namespace oxide {
59namespace qt {60namespace qt {
@@ -274,6 +275,11 @@
274275
275void ContentsView::screenUpdated() {276void ContentsView::screenUpdated() {
276 view()->ScreenUpdated();277 view()->ScreenUpdated();
278
279 // FIXME - need to recalculate location bar height in case scale changed
280 oxide::qt::WebView::FromView(
281 oxide::WebView::FromWebContents(view()->GetWebContents()))
282 ->RescaleLocationBarHeight();
277}283}
278284
279QVariant ContentsView::inputMethodQuery(Qt::InputMethodQuery query) const {285QVariant ContentsView::inputMethodQuery(Qt::InputMethodQuery query) const {
280286
=== modified file 'qt/core/browser/oxide_qt_web_view.cc'
--- qt/core/browser/oxide_qt_web_view.cc 2016-04-21 09:53:42 +0000
+++ qt/core/browser/oxide_qt_web_view.cc 2016-04-29 13:18:57 +0000
@@ -249,6 +249,7 @@
249 : contents_view_(new ContentsView(view_client, handle)),249 : contents_view_(new ContentsView(view_client, handle)),
250 client_(client),250 client_(client),
251 security_status_(security_status),251 security_status_(security_status),
252 location_bar_height_(0),
252 frame_tree_torn_down_(false) {253 frame_tree_torn_down_(false) {
253 DCHECK(client);254 DCHECK(client);
254 DCHECK(handle);255 DCHECK(handle);
@@ -946,16 +947,21 @@
946}947}
947948
948int WebView::locationBarHeight() const {949int WebView::locationBarHeight() const {
949 return DpiUtils::ConvertChromiumPixelsToQt(950 return location_bar_height_;
950 web_view_->GetLocationBarHeight(), contents_view_->GetScreen());
951}951}
952952
953void WebView::setLocationBarHeight(int height) {953void WebView::setLocationBarHeight(int height) {
954 location_bar_height_ = height;
954 web_view_->SetLocationBarHeight(955 web_view_->SetLocationBarHeight(
955 DpiUtils::ConvertQtPixelsToChromium(height,956 DpiUtils::ConvertQtPixelsToChromium(height,
956 contents_view_->GetScreen()));957 contents_view_->GetScreen()));
957}958}
958959
960 // FIXME: called on screen change, to recalculate location bar height if scale changed
961void WebView::RescaleLocationBarHeight() {
962 setLocationBarHeight(location_bar_height_);
963}
964
959int WebView::locationBarOffset() const {965int WebView::locationBarOffset() const {
960 return DpiUtils::ConvertChromiumPixelsToQt(966 return DpiUtils::ConvertChromiumPixelsToQt(
961 web_view_->GetLocationBarOffset(), contents_view_->GetScreen());967 web_view_->GetLocationBarOffset(), contents_view_->GetScreen());
962968
=== modified file 'qt/core/browser/oxide_qt_web_view.h'
--- qt/core/browser/oxide_qt_web_view.h 2016-04-20 22:09:41 +0000
+++ qt/core/browser/oxide_qt_web_view.h 2016-04-29 13:18:57 +0000
@@ -88,6 +88,8 @@
8888
89 const oxide::SecurityStatus& GetSecurityStatus() const;89 const oxide::SecurityStatus& GetSecurityStatus() const;
9090
91 void RescaleLocationBarHeight(); //FIXME: called on screen change only
92
91 private:93 private:
92 WebView(WebViewProxyClient* client,94 WebView(WebViewProxyClient* client,
93 ContentsViewProxyClient* view_client,95 ContentsViewProxyClient* view_client,
@@ -276,6 +278,7 @@
276 QPointer<OxideQSecurityStatus> security_status_;278 QPointer<OxideQSecurityStatus> security_status_;
277 QList<QObject*> message_handlers_;279 QList<QObject*> message_handlers_;
278280
281 int location_bar_height_;
279 bool frame_tree_torn_down_;282 bool frame_tree_torn_down_;
280283
281 std::unique_ptr<content::HostZoomMap::Subscription> track_zoom_subscription_;284 std::unique_ptr<content::HostZoomMap::Subscription> track_zoom_subscription_;

Subscribers

People subscribed via source and target branches

to all changes: